0% found this document useful (0 votes)
14 views39 pages

XOR Problem Neural Network Guide

Uploaded by

Michael Jeo
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views39 pages

XOR Problem Neural Network Guide

Uploaded by

Michael Jeo
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

LAB MANUAL :DEEP LEARNING

PROGRAM 1: LEARNING XOR PROBLEM


AIM

To design, train, and evaluate a neural network model using TensorFlow and Keras to
learn and predict the XOR (Exclusive OR) logical operation using a multilayer perceptron.

PROCEDURE
1. Start the program by importing the required libraries:
 numpy for numerical operations
 [Link] for building the neural network
2. Create the XOR training dataset using NumPy arrays.
 Define the input values: [0,0], [0,1], [1,0], [1,1]
 Define the corresponding XOR outputs: 0, 1, 1, 0
3. Build the neural network model using Keras Sequential API.
 Add a hidden layer with 2 neurons and ReLU activation function.
 Add an output layer with 1 neuron and Sigmoid activation function.
4. Compile the model by specifying:
 Optimizer: Adam
 Loss function: Binary Crossentropy
 Evaluation metric: Accuracy
5. Train the model using the fit() function.
 Provide the training inputs and outputs.
 Set the number of epochs (e.g., 200).
 Use verbose=0 to hide intermediate training output.
6. Evaluate the performance of the trained model using the evaluate() function.
 Obtain the accuracy and loss values on the training dataset.
7. Make predictions on the XOR input values using the predict() function.
 Print both predicted output and actual output for comparison.
8. End the program after displaying the prediction results.
PROGRAM : LEARNING XOR PROBLEM
import numpy as np
from tensorflow import keras
from [Link] import layers

# 1. Define the XOR dataset


X_train = [Link]([[0, 0], [0, 1], [1, 0], [1, 1]], dtype=np.float32)
y_train = [Link]([[0], [1], [1], [0]], dtype=np.float32)

# 2. Build the neural network model


model = [Link]([
[Link](units=2, activation='relu', input_shape=(2,)), # Hidden layer with ReLU
[Link](units=1, activation='sigmoid') # Output layer with Sigmoid for binary
classification
])

# 3. Compile the model


[Link](optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])

# 4. Train the model with a reduced number of epochs


epochs = 200 # You can experiment with this value
history = [Link](X_train, y_train, epochs=epochs, verbose=0) # verbose=0 to suppress
output during training

# 5. Evaluate the model


loss, accuracy = [Link](X_train, y_train, verbose=0)
print(f"Model accuracy after {epochs} epochs: {accuracy:.4f}")

# 6. Make predictions
predictions = [Link](X_train)
print("\nPredictions:")
for i in range(len(X_train)):
print(f"Input: {X_train[i]}, Predicted Output: {predictions[i][0]:.4f}, Actual Output:
{y_train[i][0]}")

Result:
Thus the above program was executed successfully and the result was verified.
OUTPUT

PROGRAM 2: PRE-PROCESSING OF TEXT (TOKENIZATION, FILTRATION,


SCRIPT VALIDATION, STOP WORD REMOVAL, STEMMING)
AIM

To perform text preprocessing using Python and NLTK, including tokenization,


filtration, script validation, stopword removal, and stemming, in order to clean and prepare
text data for Natural Language Processing (NLP) tasks.

PROCEDURE

1. Start the program by importing the required Python libraries such as re, nltk,
stopwords, word_tokenize, and PorterStemmer.
2. Download the necessary NLTK resources such as punkt for tokenization and
stopwords for removing common English words.
3. Define the input text that will be processed during the NLP operations.
4. Perform Tokenization using the word_tokenize() function to split the text into
individual words and punctuation marks.
5. Apply Filtration to clean the tokens by:
o Removing punctuation and numbers using regular expressions
o Converting all text to lowercase
o Eliminating empty strings from the filtered list
6. Perform Script Validation by allowing only alphabetic English words and removing
any tokens that contain digits or special characters.
7. Remove Stopwords using NLTK’s English stopword list to filter out common words
such as “is,” “the,” “in,” etc.
8. Apply Stemming using the PorterStemmer to reduce each word to its base or root
form.
9. Display the results of each step including tokenized words, filtered tokens, validated
tokens, stopword-removed tokens, and stemmed tokens.
10. End the program after printing the final stemmed output

DOWNLOAD
import nltk
[Link]('punkt')
[Link]('punkt_tab')

PROGRAM
import re
import nltk
from [Link] import stopwords
from [Link] import word_tokenize
from [Link] import PorterStemmer

# Download NLTK resources (only first time)


[Link]('punkt')
[Link]('stopwords')

# Sample text
text = "Hello!!! This is a sample TEXT, showing off text preprocessing in NLP for 2025."

print("Original Text:")
print(text)

# 1️⃣ Tokenization
tokens = word_tokenize(text)
print("\n1. Tokenization:")
print(tokens)

# 2️⃣ Filtration (remove punctuation, numbers, and make lowercase)


filtered_tokens = [[Link](r'[^a-zA-Z]', '', word).lower() for word in tokens]
filtered_tokens = [word for word in filtered_tokens if word] # remove empty strings
print("\n2. Filtration:")
print(filtered_tokens)

# 3️⃣ Script Validation (keep only alphabetic English words)


validated_tokens = [word for word in filtered_tokens if [Link]("^[a-zA-Z]+$", word)]
print("\n3. Script Validation:")
print(validated_tokens)
# 4️⃣ Stopword Removal
stop_words = set([Link]('english'))
tokens_no_stop = [word for word in validated_tokens if word not in stop_words]
print("\n4. Stop Word Removal:")
print(tokens_no_stop)

# 5️⃣ Stemming
ps = PorterStemmer()
stemmed_tokens = [[Link](word) for word in tokens_no_stop]
print("\n5. Stemming:")
print(stemmed_tokens)

Result:
Thus the above program was executed successfully and the result was verified.

OUTPUT
PROGRAM 3: CNN MODEL
AIM

To design and implement a Convolutional Neural Network (CNN) using TensorFlow and
Keras for image classification by adding convolution, pooling, flattening, and fully connected
layers.

PROCEDURE

1. Import the required libraries from TensorFlow Keras, including Sequential,


Conv2D, MaxPooling2D, Flatten, and Dense.
2. Initialize the CNN model by creating an instance of the Sequential() class.
3. Add the first Convolutional layer using Conv2D with:

 32 filters
 Kernel size of 3×3
 ReLU activation function
 Input shape of 64×64×3 for colored images

4. Add a Max Pooling layer using MaxPooling2D with a pool size of 2×2 to reduce the
spatial dimensions of feature maps.
5. Flatten the pooled feature maps using the Flatten() layer to convert them into a 1D
vector for the fully connected layer.
6. Add a Fully Connected (Dense) layer with 128 neurons and ReLU activation to
learn complex patterns.
7. Add the Output layer using Dense() with 10 neurons and softmax activation for
multi-class classification (10 classes).
8. Compile the model using:

 Adam optimizer
 Categorical crossentropy loss function
 Accuracy as the evaluation metric

9. Display the model summary using [Link]() to show the layer structure,
output shapes, and parameter counts.

PROGRAM
# Import Keras libraries
from [Link] import Sequential
from [Link] import Conv2D, MaxPooling2D, Flatten, Dense
# Step 1: Initialize the CNN
model = Sequential()
# Step 2: Add convolutional layer
[Link](Conv2D(32, (3, 3), activation='relu', input_shape=(64, 64, 3)))
# Step 3: Add pooling layer
[Link](MaxPooling2D(pool_size=(2, 2)))
# Step 4: Flatten
[Link](Flatten( ))
# Step 5: Fully connected layer
[Link](Dense(units=128, activation='relu'))
# Step 6: Output layer (for 10 classes)
[Link](Dense(units=10, activation='softmax'))
# Step 7: Compile the CNN
[Link](optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
# Step 8: Display model summary
[Link]()

Result:
Thus the above program was executed successfully and the result was verified.

OUTPUT
PROGRAM 4:SIMPLE CNN PROGRAM FOR IMAGE CLASSIFICATION
AIM
To build and compile a Convolutional Neural Network (CNN) using
TensorFlow/Keras for image classification using convolution, pooling, flattening, and fully
connected layers.
PROCEDURE
1: Import Required Libraries

 Import Sequential model from Keras.


 Import necessary layers: Conv2D, MaxPooling2D, Flatten, and Dense.

2: Initialize the CNN

 Create an empty Sequential() model to add layers one by one.

3: Add a Convolution Layer

 Add a Conv2D layer with 32 filters of size 3×3.


 Use activation function ReLU.
 Set the input image size to 64 × 64 × 3 (RGB).
4: Add a Max Pooling Layer

 Add a MaxPooling2D layer with pool size 2×2.


 This reduces the spatial dimension and helps in extracting important features.

5: Flatten the Feature Maps

 Add a Flatten() layer to convert 2D feature maps into a 1D vector.


 This prepares the data for the fully connected layers.

6: Add a Fully Connected Layer

 Add a Dense layer with 128 neurons and ReLU activation.


 This layer learns complex patterns from the extracted features.

7: Add the Output Layer

 Add a Dense layer with 10 units (for 10 classes).


 Use softmax activation to convert outputs into probability values.

8: Compile the Model

 Compile the CNN using:


o Optimizer: Adam
o Loss function: Categorical Crossentropy
o Metric: Accuracy

9: Display the Model Summary

 Use [Link]() to display:


o Number of layers
o Parameters in each layer
o Output shapes of each layer
PROGRAM
import tensorflow as tf
from [Link] import datasets, layers, models
import [Link] as plt

# Load CIFAR-10 dataset (10 classes, 60k images of size 32x32)


(x_train, y_train), (x_test, y_test) = datasets.cifar10.load_data()

# Normalize pixel values (0–255 → 0–1)


x_train, x_test = x_train / 255.0, x_test / 255.0

# Build a simple CNN model


model = [Link]([
layers.Conv2D(32, (3,3), activation='relu', input_shape=(32,32,3)),
layers.MaxPooling2D((2,2)),
layers.Conv2D(64, (3,3), activation='relu'),
layers.MaxPooling2D((2,2)),
[Link](),
[Link](64, activation='relu'),
[Link](10, activation='softmax') # 10 output classes
])

# Compile the model


[Link](optimizer='adam',
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])

# Train the model (for simplicity, 5 epochs)


[Link](x_train, y_train, epochs=5, validation_data=(x_test, y_test))

# Evaluate on test data


test_loss, test_acc = [Link](x_test, y_test, verbose=2)
print("\nTest accuracy:", test_acc)

# Predict first 10 images


predictions = [Link](x_test[:10])

# Show first 10 test images with predicted labels


class_names = ['airplane','automobile','bird','cat','deer',
'dog','frog','horse','ship','truck']

[Link](figsize=(10,5))
for i in range(10):
[Link](2,5,i+1)
[Link]([]); [Link]([])
[Link](x_test[i])
pred_label = class_names[predictions[i].argmax()]
true_label = class_names[y_test[i][0]]
[Link](f"P:{pred_label}\nT:{true_label}", fontsize=8)
[Link]()

Result:
Thus the above program was executed successfully and the result was verified.
OUTPUT
PROGRAM 5:BUILDING CNN MODEL FOR DIGIT IDENTIFICATION
AIM

To design, train, and evaluate a Convolutional Neural Network (CNN) using the
MNIST handwritten digits dataset for image classification.

PROCEDURE

1. Load the MNIST dataset and split it into training and testing sets.
 Preprocess the images by reshaping them to 28×28×1 and normalizing pixel
values to 0–1.
 One-hot encode the labels for 10 output classes.
2. Build the CNN model using:
3. Two convolution + max-pooling layers
4. Flatten layer
5. Dense layer with ReLU
6. Dropout layer
7. Output layer with softmax
 Compile the model using Adam optimizer and categorical crossentropy loss.
 Train the model using training data for 10 epochs.
 Evaluate the model on test data to get accuracy and loss.
 Make predictions (optional) on a sample image.
PROGRAM
import tensorflow as tf
from [Link] import Sequential
from [Link] import Conv2D, MaxPooling2D, Flatten, Dense, Dropout
from [Link] import mnist
from [Link] import to_categorical
import numpy as np

# 1. Load and Prepare the Dataset


(X_train, y_train), (X_test, y_test) = mnist.load_data()

# Reshape data to include a channel dimension (required for Conv2D)


X_train = X_train.reshape(X_train.shape[0], 28, 28, 1).astype('float32')
X_test = X_test.reshape(X_test.shape[0], 28, 28, 1).astype('float32')
# Normalize pixel values to the range [0, 1]
X_train = X_train / 255
X_test = X_test / 255

# One-hot encode the target variable (labels)


y_train = to_categorical(y_train)
y_test = to_categorical(y_test)

# 2. Build the CNN Model


model = Sequential()

# First Convolutional Layer


[Link](Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)))
[Link](MaxPooling2D((2, 2)))

# Second Convolutional Layer


[Link](Conv2D(64, (3, 3), activation='relu'))
[Link](MaxPooling2D((2, 2)))

# Flatten the output for the Dense layers


[Link](Flatten())

# Dense Layers
[Link](Dense(128, activation='relu'))
[Link](Dropout(0.5)) # Dropout for regularization
[Link](Dense(10, activation='softmax')) # Output layer for 10 digits

# 3. Compile the Model


[Link](optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])

# 4. Train the Model


print("Training the CNN model...")
history = [Link](X_train, y_train, epochs=10, batch_size=128, validation_data=(X_test,
y_test), verbose=1)

# 5. Evaluate the Model


print("\nEvaluating the CNN model...")
loss, accuracy = [Link](X_test, y_test, verbose=0)
print(f"Test Loss: {loss:.4f}")
print(f"Test Accuracy: {accuracy:.4f}")

# 6. Make Predictions (Optional)


print("\nMaking predictions on a sample image...")
sample_image_index = 0 # You can change this to test different images
sample_image = X_test[sample_image_index]
true_label = [Link](y_test[sample_image_index])

# Reshape for prediction (add batch dimension)


sample_image_for_prediction = np.expand_dims(sample_image, axis=0)
prediction = [Link](sample_image_for_prediction)
predicted_digit = [Link](prediction)

print(f"True label for sample image {sample_image_index}: {true_label}")


print(f"Predicted digit for sample image {sample_image_index}: {predicted_digit}")
Result:
Thus the above program was executed successfully and the result was verified.

OUTPUT
PROGRAM 6:CHUNKING AND NAMED ENTITY RECOGNITION USING NLTK
AIM

To perform chunking (shallow parsing) on a given sentence using NLTK by


tokenizing, POS tagging, and applying a chunk grammar rule.

PROCEDURE

1. Import NLTK libraries for tokenizing, POS tagging, and chunking.


2. Give an input sentence that you want to chunk.
3. Tokenize the sentence using word_tokenize().
4. Apply POS tagging with pos_tag() to label each word with its part of speech.
5. Define a chunk grammar rule (e.g., noun phrase pattern).
6. Create a chunk parser using RegexpParser().
7. Parse the tagged sentence to form chunks.
8. Print or draw the chunk tree to display the result.
PROGRAM
import nltk
from nltk import word_tokenize, pos_tag, RegexpParser

# Example sentence
sentence = "The quick brown fox jumps over the lazy dog"

# Step 1: Tokenize the sentence


words = word_tokenize(sentence)

# Step 2: Tag each word with its part of speech


tagged_words = pos_tag(words)

# Step 3: Define a chunk grammar


grammar = "NP: {<DT>?<JJ>*<NN>}"
# Step 4: Create a chunk parser
parser = RegexpParser(grammar)

# Step 5: Parse the tagged words


chunked_sentence = [Link](tagged_words)

# Step 6: Display the result


print(chunked_sentence)
chunked_sentence.draw() # optional: shows tree diagram (if using GUI)

Result:
Thus the above program was executed successfully and the result was verified.

OUTPUT
PROGRAM 7:NAMED ENTITY RECOGNITION USING NLTK
AIM

To perform Named Entity Recognition (NER) on a given text using NLTK by


tokenizing, POS tagging, and applying the NE Chunker.

PROCEDURE

1. Import required NLTK modules for tokenizing, POS tagging, and named entity
chunking.
2. Download necessary NLTK datasets such as punkt, tagger, NE chunker, and word
lists.
3. Define an NER function that:
o Tokenizes the text using word_tokenize()
o Tags each token with its part of speech using pos_tag()
o Applies named entity chunking using ne_chunk()
4. Pass an input text to this function.
5. Print the output, which shows named entities like persons, organizations, and
locations.
PROGRAM
import nltk
from [Link] import word_tokenize
from nltk import pos_tag, ne_chunk

[Link]('punkt')
[Link]('averaged_perceptron_tagger')
[Link]('maxent_ne_chunker')
[Link]('words')

def ner(text):
words = word_tokenize(text)
tagged_words = pos_tag(words)
named_entities = ne_chunk(tagged_words)
return named_entities
text = "Apple is a company based in California, United States. Steve Jobs was one of its
founders."
named_entities = ner(text)
print(named_entities)

Result:
Thus the above program was executed successfully and the result was verified.
OUTPUT
PROGRAM 8:FEED FORWARD NEURAL NETWORK

AIM

To build, train, and test a simple Feed Forward Neural Network (FFNN) using
dummy input-output data to perform regression and make a prediction for a new input
sample.

PROCEDURE

1. Import libraries
Load NumPy for data creation and Keras for building the neural network.
2. Create dummy dataset
Generate random input data with 5 features and random output values.
3. Build the neural network
o Add a Dense hidden layer with 8 neurons and ReLU activation.
o Add an output layer with 1 neuron for regression.
4. Compile the model
Use Adam optimizer and Mean Squared Error (MSE) as the loss function.
5. Train the model
Fit the model using the dummy dataset for 10 epochs with batch size 8.
6. Make a prediction
Create a random test input and use the trained model to predict the output.
PROGRAM
import numpy as np
from [Link] import Sequential
from [Link] import Dense
# Create dummy input data (100 samples, each with 5 features)
X = [Link](100, 5)
# Create dummy output data (100 samples, 1 output)
y = [Link](100, 1)
# Build the Feed Forward Neural Network
model = Sequential()
[Link](Dense(8, activation='relu', input_dim=5)) # hidden layer
[Link](Dense(1, activation='linear')) # output layer
# Compile the model
[Link](optimizer='adam', loss='mse')
# Train the model
[Link](X, y, epochs=10, batch_size=8, verbose=1)
# Make a prediction
test_sample = [Link](1, 5)
prediction = [Link](test_sample)
print("Test Input:", test_sample)
print("Prediction:", prediction)

Result:
Thus the above program was executed successfully and the result was verified.

OUTPUT
PROGRAM 9:CHARACTER-LEVEL TEXT PREDICTION USING RNN

AIM

To build and train a simple Recurrent Neural Network (RNN) that learns character-to-
character prediction from the text "hello world" and predicts the next character for a given
input character.

PROCEDURE

1. Import libraries such as NumPy, Sequential model, SimpleRNN, Dense, and one-hot
encoding utilities.
2. Load the training text ("hello world") and create character-to-index and index-to-
character mappings.
3. Prepare the dataset by creating input-output pairs where each character predicts the
next character.
4. Convert characters to one-hot vectors using to_categorical().
5. Reshape data to fit RNN input format: (samples, timesteps, features).
6. Build the model with a SimpleRNN layer followed by a Dense softmax output layer.
7. Compile the model using categorical crossentropy loss and Adam optimizer.
8. Train the model on the prepared dataset.
9. Test the model by giving an input character and predicting the next character.
PROGRAM

import numpy as np

from [Link] import Sequential

from [Link] import SimpleRNN, Dense

from [Link] import to_categorical

# Training text

text = "hello world"

# Create character mappings

chars = sorted(list(set(text)))
char_to_idx = {c:i for i,c in enumerate(chars)}

idx_to_char = {i:c for i,c in enumerate(chars)}

# Prepare dataset (input-output pairs)

X_data = []

y_data = []

for i in range(len(text) - 1):

X_data.append(char_to_idx[text[i]])

y_data.append(char_to_idx[text[i+1]])

X = to_categorical(X_data, num_classes=len(chars))

y = to_categorical(y_data, num_classes=len(chars))

# Reshape for RNN: (samples, timesteps, features)

X = [Link](len(X), 1, len(chars))

# Build RNN Model

model = Sequential()

[Link](SimpleRNN(16, input_shape=(1, len(chars))))

[Link](Dense(len(chars), activation='softmax'))

[Link](loss='categorical_crossentropy', optimizer='adam')

[Link](X, y, epochs=100, verbose=0)


# Predict the next character

input_char = "h"

x_test = to_categorical([char_to_idx[input_char]], num_classes=len(chars))

x_test = x_test.reshape(1, 1, len(chars))

prediction = [Link](x_test)

predicted_char = idx_to_char[[Link](prediction)]

print(f"Input Character: {input_char}")

print(f"Predicted Next Character: {predicted_char}")

Result:
Thus the above program was executed successfully and the result was verified.

OUTPUT
PROGRAM 10:AUTOENCODER

AIM

To build, train, and evaluate an Autoencoder model using the MNIST handwritten digit
dataset to learn compressed representations of images and reconstruct them back to their
original form.

PROCEDURE

1. Import necessary libraries

 Import NumPy for numerical operations.


 Import Matplotlib for displaying images.
 Import MNIST dataset from Keras.
 Import Keras layers such as Input, Dense, Flatten, and Reshape.
 Import Adam optimizer.

2. Load the MNIST dataset


 Load training and testing data using mnist.load_data().
 Ignore labels because an autoencoder performs unsupervised learning.

3. Normalize the dataset

 Convert pixel values from the range 0–255 to 0–1 by dividing by 255.
 Helps in faster and stable training.

4. Reshape the dataset

 Add a channel dimension to the images.


 Change shape from (28, 28) to (28, 28, 1) to match Keras model input format.

5. Define the autoencoder architecture

Encoder

 Create an input layer of shape (28, 28, 1).


 Flatten the input image to a vector of length 784.
 Add a Dense layer with 64 neurons (compressed encoded representation).

Decoder

 Add a Dense layer to expand encoded vector back to 784 values.


 Reshape output back to image format (28, 28, 1).

PROGRAM
# Import necessary libraries
import numpy as np
import [Link] as plt
from [Link] import mnist
from [Link] import Model
from [Link] import Input, Dense, Flatten, Reshape
from [Link] import Adam

# Load the dataset


(x_train, _), (x_test, _) = mnist.load_data()

# Normalize the data


x_train = x_train.astype('float32') / 255.0
x_test = x_test.astype('float32') / 255.0

# Reshape the data to include the channel dimension


x_train = [Link](x_train, (len(x_train), 28, 28, 1))
x_test = [Link](x_test, (len(x_test), 28, 28, 1))

# Define the input shape for the autoencoder


input_shape = (28, 28, 1)

# Define the encoder part of the autoencoder


input_img = Input(shape=input_shape)
x = Flatten()(input_img)
encoded = Dense(64, activation='relu')(x)

# Define the decoder part of the autoencoder


decoded = Dense(784, activation='sigmoid')(encoded)
decoded = Reshape((28, 28, 1))(decoded)

# Define the complete autoencoder model


autoencoder = Model(input_img, decoded)

[Link](optimizer=Adam(), loss='binary_crossentropy')

# Print the summary of the autoencoder model


[Link]()

# Train the autoencoder


[Link](x_train, x_train,
epochs=50, # Number of epochs to train
batch_size=256, # Batch size for training
shuffle=True,
validation_data=(x_test, x_test)
)

# Predict the reconstructed images from the test set


decoded_imgs = [Link](x_test)

# Number of digits to display


n = 10

# Create a figure with a specified size


[Link](figsize=(20, 4))

# Loop through the first n test images


for i in range(n):
# Display the original image
ax = [Link](2, n, i + 1)
[Link](x_test[i].reshape(28, 28), cmap='gray')
[Link]("Original") # Set the title of the plot
[Link]('off')

# Display the reconstructed image


ax = [Link](2, n, i + 1 + n)
[Link](decoded_imgs[i].reshape(28, 28), cmap='gray')
[Link]("Reconstructed")
[Link]('off')

# Show the figure


[Link]()
Result:
Thus the above program was executed successfully and the result was verified.

OUTPUT

You might also like