class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: H = None
        self.u: H = None
        self.x: H = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: H = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: A = None
        self.x: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: E = None
        self.p: I = None
        self.x: G = None
        self.u: I = None
        self.w: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: J = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: I = None
        self.s: A = None
        self.y: D = None
        self.w: E = None
        self.t: C = None
        self.r: A = None
        self.p: B = None
        self.u: D = None
        self.o: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: H = None
        self.o: A = None
        self.p: B = None
        self.z: H = None
        self.s: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: F = None
        self.u: H = None
        self.x: H = None
        self.w: G = None
        self.txt = txt

a = A("a")
m = B("m")
k = C("k")
j = D("j")
n = E("n")
e = F("e")
h = G("h")
c = H("c")
l = I("l")
b = J("b")

a.z = h
a.p = c
a.u = c
a.x = c
a.y = c
m.x = h
m.v = c
m.t = k
k.y = h
k.o = a
k.x = b
j.v = c
n.q = a
n.y = k
e.z = m
e.q = n
e.p = l
e.u = l
e.x = h
e.w = b
h.x = b
h.s = l
c.x = h
c.v = l
c.s = a
c.r = a
c.y = j
c.u = j
c.w = n
c.o = n
c.t = k
c.p = m
l.x = a
l.o = a
l.u = c
l.z = c
l.p = m
l.s = b
b.s = h
b.w = h
b.v = e
b.u = c
b.x = c
assert h.x.u.s.p.u.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: H = None
        self.u: H = None
        self.x: H = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: H = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: A = None
        self.x: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: E = None
        self.p: I = None
        self.x: G = None
        self.u: I = None
        self.w: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: J = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: I = None
        self.s: A = None
        self.y: D = None
        self.w: E = None
        self.t: C = None
        self.r: A = None
        self.p: B = None
        self.u: D = None
        self.o: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: H = None
        self.o: A = None
        self.p: B = None
        self.z: H = None
        self.s: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: F = None
        self.u: H = None
        self.x: H = None
        self.w: G = None
        self.txt = txt

a = A("a")
m = B("m")
k = C("k")
j = D("j")
n = E("n")
e = F("e")
h = G("h")
c = H("c")
l = I("l")
b = J("b")

a.z = h
a.p = c
a.u = c
a.x = c
a.y = c
m.x = h
m.v = c
m.t = k
k.y = h
k.o = a
k.x = b
j.v = c
n.q = a
n.y = k
e.z = m
e.q = n
e.p = l
e.u = l
e.x = h
e.w = b
h.x = b
h.s = l
c.x = h
c.v = l
c.s = a
c.r = a
c.y = j
c.u = j
c.w = n
c.o = n
c.t = k
c.p = m
l.x = a
l.o = a
l.u = c
l.z = c
l.p = m
l.s = b
b.s = h
b.w = h
b.v = e
b.u = c
b.x = c
assert h.x.u.s.p.u.v.x.txt == "h"