





import unittest

from transformers import AlbertConfig, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
					import torch

					from transformers import (
					    MODEL_FOR_PRETRAINING_MAPPING,
					    AlbertForMaskedLM,
					    AlbertForMultipleChoice,
					    AlbertForPreTraining,
					    AlbertForQuestionAnswering,
					    AlbertForSequenceClassification,
					    AlbertForTokenClassification,
					    AlbertModel,
					)
					from transformers.models.albert.modeling_albert import ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST
class      UpperCamelCase_						:




					def __init__(						self			,  lowerCAmelCase_			,  lowerCAmelCase_=13			,  lowerCAmelCase_=7			,  lowerCAmelCase_=True			,  lowerCAmelCase_=True			,  lowerCAmelCase_=True			,  lowerCAmelCase_=True			,  lowerCAmelCase_=99			,  lowerCAmelCase_=16			,  lowerCAmelCase_=36			,  lowerCAmelCase_=6			,  lowerCAmelCase_=6			,  lowerCAmelCase_=6			,  lowerCAmelCase_=37			,  lowerCAmelCase_="gelu"			,  lowerCAmelCase_=0.1			,  lowerCAmelCase_=0.1			,  lowerCAmelCase_=512			,  lowerCAmelCase_=16			,  lowerCAmelCase_=2			,  lowerCAmelCase_=0.02			,  lowerCAmelCase_=3			,  lowerCAmelCase_=4			,  lowerCAmelCase_=None			,  )						->							Tuple:
										_snake_case													=			parent
										_snake_case													=			batch_size
										_snake_case													=			seq_length
										_snake_case													=			is_training
										_snake_case													=			use_input_mask
										_snake_case													=			use_token_type_ids
										_snake_case													=			use_labels
										_snake_case													=			vocab_size
										_snake_case													=			embedding_size
										_snake_case													=			hidden_size
										_snake_case													=			num_hidden_layers
										_snake_case													=			num_hidden_groups
										_snake_case													=			num_attention_heads
										_snake_case													=			intermediate_size
										_snake_case													=			hidden_act
										_snake_case													=			hidden_dropout_prob
										_snake_case													=			attention_probs_dropout_prob
										_snake_case													=			max_position_embeddings
										_snake_case													=			type_vocab_size
										_snake_case													=			type_sequence_label_size
										_snake_case													=			initializer_range
										_snake_case													=			num_labels
										_snake_case													=			num_choices
										_snake_case													=			scope




					def 		lowerCAmelCase     (						self					)						->							Union[str, Any]:
										_snake_case													=			ids_tensor([self.batch_size, self.seq_length]			,  self.vocab_size					)

										_snake_case													=			None
										if self.use_input_mask:
															_snake_case													=			random_attention_mask([self.batch_size, self.seq_length]					)

										_snake_case													=			None
										if self.use_token_type_ids:
															_snake_case													=			ids_tensor([self.batch_size, self.seq_length]			,  self.type_vocab_size					)

										_snake_case													=			None
										_snake_case													=			None
										_snake_case													=			None
										if self.use_labels:
															_snake_case													=			ids_tensor([self.batch_size]			,  self.type_sequence_label_size					)
															_snake_case													=			ids_tensor([self.batch_size, self.seq_length]			,  self.num_labels					)
															_snake_case													=			ids_tensor([self.batch_size]			,  self.num_choices					)

										_snake_case													=			self.get_config()

										return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels




					def 		lowerCAmelCase     (						self					)						->							Optional[int]:
										return AlbertConfig(
										    vocab_size=self.vocab_size			,  hidden_size=self.hidden_size			,  num_hidden_layers=self.num_hidden_layers			,  num_attention_heads=self.num_attention_heads			,  intermediate_size=self.intermediate_size			,  hidden_act=self.hidden_act			,  hidden_dropout_prob=self.hidden_dropout_prob			,  attention_probs_dropout_prob=self.attention_probs_dropout_prob			,  max_position_embeddings=self.max_position_embeddings			,  type_vocab_size=self.type_vocab_size			,  initializer_range=self.initializer_range			,  num_hidden_groups=self.num_hidden_groups			,  )




					def 		lowerCAmelCase     (						self			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_					)						->							Any:
										_snake_case													=			AlbertModel(config=_lowerCAmelCase					)
										model.to(_lowerCAmelCase					)
										model.eval()
										_snake_case													=			model(_lowerCAmelCase			,  attention_mask=_lowerCAmelCase			,  token_type_ids=_lowerCAmelCase					)
										_snake_case													=			model(_lowerCAmelCase			,  token_type_ids=_lowerCAmelCase					)
										_snake_case													=			model(_lowerCAmelCase					)
										self.parent.assertEqual(result.last_hidden_state.shape			,  (self.batch_size, self.seq_length, self.hidden_size)					)
										self.parent.assertEqual(result.pooler_output.shape			,  (self.batch_size, self.hidden_size)					)




					def 		lowerCAmelCase     (						self			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_					)						->							List[str]:
										_snake_case													=			AlbertForPreTraining(config=_lowerCAmelCase					)
										model.to(_lowerCAmelCase					)
										model.eval()
										_snake_case													=			model(
										    _lowerCAmelCase			,  attention_mask=_lowerCAmelCase			,  token_type_ids=_lowerCAmelCase			,  labels=_lowerCAmelCase			,  sentence_order_label=_lowerCAmelCase			,  )
										self.parent.assertEqual(result.prediction_logits.shape			,  (self.batch_size, self.seq_length, self.vocab_size)					)
										self.parent.assertEqual(result.sop_logits.shape			,  (self.batch_size, config.num_labels)					)




					def 		lowerCAmelCase     (						self			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_					)						->							Dict:
										_snake_case													=			AlbertForMaskedLM(config=_lowerCAmelCase					)
										model.to(_lowerCAmelCase					)
										model.eval()
										_snake_case													=			model(_lowerCAmelCase			,  attention_mask=_lowerCAmelCase			,  token_type_ids=_lowerCAmelCase			,  labels=_lowerCAmelCase					)
										self.parent.assertEqual(result.logits.shape			,  (self.batch_size, self.seq_length, self.vocab_size)					)




					def 		lowerCAmelCase     (						self			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_					)						->							Dict:
										_snake_case													=			AlbertForQuestionAnswering(config=_lowerCAmelCase					)
										model.to(_lowerCAmelCase					)
										model.eval()
										_snake_case													=			model(
										    _lowerCAmelCase			,  attention_mask=_lowerCAmelCase			,  token_type_ids=_lowerCAmelCase			,  start_positions=_lowerCAmelCase			,  end_positions=_lowerCAmelCase			,  )
										self.parent.assertEqual(result.start_logits.shape			,  (self.batch_size, self.seq_length)					)
										self.parent.assertEqual(result.end_logits.shape			,  (self.batch_size, self.seq_length)					)




					def 		lowerCAmelCase     (						self			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_					)						->							Optional[int]:
										_snake_case													=			self.num_labels
										_snake_case													=			AlbertForSequenceClassification(_lowerCAmelCase					)
										model.to(_lowerCAmelCase					)
										model.eval()
										_snake_case													=			model(_lowerCAmelCase			,  attention_mask=_lowerCAmelCase			,  token_type_ids=_lowerCAmelCase			,  labels=_lowerCAmelCase					)
										self.parent.assertEqual(result.logits.shape			,  (self.batch_size, self.num_labels)					)




					def 		lowerCAmelCase     (						self			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_					)						->							str:
										_snake_case													=			self.num_labels
										_snake_case													=			AlbertForTokenClassification(config=_lowerCAmelCase					)
										model.to(_lowerCAmelCase					)
										model.eval()
										_snake_case													=			model(_lowerCAmelCase			,  attention_mask=_lowerCAmelCase			,  token_type_ids=_lowerCAmelCase			,  labels=_lowerCAmelCase					)
										self.parent.assertEqual(result.logits.shape			,  (self.batch_size, self.seq_length, self.num_labels)					)




					def 		lowerCAmelCase     (						self			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_					)						->							Any:
										_snake_case													=			self.num_choices
										_snake_case													=			AlbertForMultipleChoice(config=_lowerCAmelCase					)
										model.to(_lowerCAmelCase					)
										model.eval()
										_snake_case													=			input_ids.unsqueeze(1					).expand(-1			,  self.num_choices			,  -1					).contiguous()
										_snake_case													=			token_type_ids.unsqueeze(1					).expand(-1			,  self.num_choices			,  -1					).contiguous()
										_snake_case													=			input_mask.unsqueeze(1					).expand(-1			,  self.num_choices			,  -1					).contiguous()
										_snake_case													=			model(
										    _lowerCAmelCase			,  attention_mask=_lowerCAmelCase			,  token_type_ids=_lowerCAmelCase			,  labels=_lowerCAmelCase			,  )
										self.parent.assertEqual(result.logits.shape			,  (self.batch_size, self.num_choices)					)






					def 		lowerCAmelCase     (						self					)						->							Dict:
										_snake_case													=			self.prepare_config_and_inputs()
										(
										    _snake_case				
										)													=			config_and_inputs
										_snake_case													=			{"""input_ids""": input_ids, """token_type_ids""": token_type_ids, """attention_mask""": input_mask}
										return config, inputs_dict





@require_torch
class      UpperCamelCase_						(					__UpperCamelCase							,					__UpperCamelCase							,					unittest.TestCase   ):
					lowerCAmelCase_							=		(
					    (
					        AlbertModel,
					        AlbertForPreTraining,
					        AlbertForMaskedLM,
					        AlbertForMultipleChoice,
					        AlbertForSequenceClassification,
					        AlbertForTokenClassification,
					        AlbertForQuestionAnswering,
					    )
					    if is_torch_available()
					    else ()
					)
					lowerCAmelCase_							=		(
					    {
					        "feature-extraction": AlbertModel,
					        "fill-mask": AlbertForMaskedLM,
					        "question-answering": AlbertForQuestionAnswering,
					        "text-classification": AlbertForSequenceClassification,
					        "token-classification": AlbertForTokenClassification,
					        "zero-shot": AlbertForSequenceClassification,
					    }
					    if is_torch_available()
					    else {}
					)
					lowerCAmelCase_							=		True




					def 		lowerCAmelCase     (						self			,  lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_=False					)						->							Optional[int]:
										_snake_case													=			super()._prepare_for_class(_lowerCAmelCase			,  _lowerCAmelCase			,  return_labels=_lowerCAmelCase					)

										if return_labels:
															if model_class in get_values(_lowerCAmelCase					):
																				_snake_case													=			torch.zeros(
																				    (self.model_tester.batch_size, self.model_tester.seq_length)			,  dtype=torch.long			,  device=_lowerCAmelCase					)
																				_snake_case													=			torch.zeros(
																				    self.model_tester.batch_size			,  dtype=torch.long			,  device=_lowerCAmelCase					)
										return inputs_dict




					def 		lowerCAmelCase     (						self					)						->							List[Any]:
										_snake_case													=			AlbertModelTester(self					)
										_snake_case													=			ConfigTester(self			,  config_class=_lowerCAmelCase			,  hidden_size=37					)




					def 		lowerCAmelCase     (						self					)						->							Optional[Any]:
										self.config_tester.run_common_tests()




					def 		lowerCAmelCase     (						self					)						->							Any:
										_snake_case													=			self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_model(*_lowerCAmelCase					)




					def 		lowerCAmelCase     (						self					)						->							int:
										_snake_case													=			self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_for_pretraining(*_lowerCAmelCase					)




					def 		lowerCAmelCase     (						self					)						->							Any:
										_snake_case													=			self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_for_masked_lm(*_lowerCAmelCase					)




					def 		lowerCAmelCase     (						self					)						->							List[Any]:
										_snake_case													=			self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_for_multiple_choice(*_lowerCAmelCase					)




					def 		lowerCAmelCase     (						self					)						->							str:
										_snake_case													=			self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_for_question_answering(*_lowerCAmelCase					)




					def 		lowerCAmelCase     (						self					)						->							Any:
										_snake_case													=			self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_for_sequence_classification(*_lowerCAmelCase					)




					def 		lowerCAmelCase     (						self					)						->							Dict:
										_snake_case													=			self.model_tester.prepare_config_and_inputs()
										for type in ["absolute", "relative_key", "relative_key_query"]:
															_snake_case													=			type
															self.model_tester.create_and_check_model(*_lowerCAmelCase					)






					@slow
					def 		lowerCAmelCase     (						self					)						->							Tuple:
										for model_name in ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
															_snake_case													=			AlbertModel.from_pretrained(_lowerCAmelCase					)
															self.assertIsNotNone(_lowerCAmelCase					)





@require_torch
class      UpperCamelCase_						(					unittest.TestCase   ):




					@slow
					def 		lowerCAmelCase     (						self					)						->							str:
										_snake_case													=			AlbertModel.from_pretrained('albert-base-v2'					)
										_snake_case													=			torch.tensor([[0, 345, 232, 328, 740, 140, 1695, 69, 6078, 1588, 2]]					)
										_snake_case													=			torch.tensor([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]					)
										with torch.no_grad():
															_snake_case													=			model(_lowerCAmelCase			,  attention_mask=_lowerCAmelCase					)[0]
										_snake_case													=			torch.Size((1, 11, 768)					)
										self.assertEqual(output.shape			,  _lowerCAmelCase					)
										_snake_case													=			torch.tensor(
										    [[[-0.65_13, 1.50_35, -0.27_66], [-0.65_15, 1.50_46, -0.27_80], [-0.65_12, 1.50_49, -0.27_84]]]					)

										self.assertTrue(torch.allclose(output[:, 1:4, 1:4]			,  _lowerCAmelCase			,  atol=1E-4					)					)










def   lowerCamelCase__       (       )     ->	int:



					'''simple docstring'''




					return 1





def   lowerCamelCase__       (       UpperCamelCase__     :    int  )     ->	int:



					'''simple docstring'''




					return 0 if x < 0 else two_pence(x - 2  ) + one_pence()





def   lowerCamelCase__       (       UpperCamelCase__     :    int  )     ->	int:



					'''simple docstring'''




					return 0 if x < 0 else five_pence(x - 5  ) + two_pence(UpperCamelCase__  )





def   lowerCamelCase__       (       UpperCamelCase__     :    int  )     ->	int:



					'''simple docstring'''




					return 0 if x < 0 else ten_pence(x - 10  ) + five_pence(UpperCamelCase__  )





def   lowerCamelCase__       (       UpperCamelCase__     :    int  )     ->	int:



					'''simple docstring'''




					return 0 if x < 0 else twenty_pence(x - 20  ) + ten_pence(UpperCamelCase__  )





def   lowerCamelCase__       (       UpperCamelCase__     :    int  )     ->	int:



					'''simple docstring'''




					return 0 if x < 0 else fifty_pence(x - 50  ) + twenty_pence(UpperCamelCase__  )





def   lowerCamelCase__       (       UpperCamelCase__     :    int  )     ->	int:



					'''simple docstring'''




					return 0 if x < 0 else one_pound(x - 100  ) + fifty_pence(UpperCamelCase__  )





def   lowerCamelCase__       (       UpperCamelCase__     :    int  )     ->	int:



					'''simple docstring'''




					return 0 if x < 0 else two_pound(x - 200  ) + one_pound(UpperCamelCase__  )





def   lowerCamelCase__       (       UpperCamelCase__     :    int = 200  )     ->	int:



					'''simple docstring'''




					return two_pound(UpperCamelCase__  )


if __name__ == "__main__":
					print(solution(int(input().strip())))



