class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: B = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: C = None
        self.r: F = None
        self.z: A = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.o: D = None
        self.r: F = None
        self.y: B = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: E = None
        self.u: B = None
        self.txt = txt

h = A("h")
a = B("a")
g = C("g")
i = D("i")
n = E("n")
b = F("b")
j = D("j")

h.z = n
h.p = a
h.y = j
a.t = n
a.p = g
a.r = b
a.s = b
a.z = h
g.p = b
g.t = a
i.p = j
i.o = j
i.z = b
i.r = b
i.q = b
i.y = a
n.r = b
n.y = h
b.y = h
b.p = n
b.u = a
j.p = i
j.o = i
j.z = b
j.r = b
j.q = b
j.y = a
assert i.o.p.r.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: B = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: C = None
        self.r: F = None
        self.z: A = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.o: D = None
        self.r: F = None
        self.y: B = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: E = None
        self.u: B = None
        self.txt = txt

h = A("h")
a = B("a")
g = C("g")
i = D("i")
n = E("n")
b = F("b")
j = D("j")

h.z = n
h.p = a
h.y = j
a.t = n
a.p = g
a.r = b
a.s = b
a.z = h
g.p = b
g.t = a
i.p = j
i.o = j
i.z = b
i.r = b
i.q = b
i.y = a
n.r = b
n.y = h
b.y = h
b.p = n
b.u = a
j.p = i
j.o = i
j.z = b
j.r = b
j.q = b
j.y = a
assert i.o.p.r.u.r.txt == "b"