class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: C = None
        self.z: A = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: F = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: C = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: E = None
        self.u: G = None
        self.p: D = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: F = None
        self.txt = txt

i = A("i")
n = B("n")
j = C("j")
b = D("b")
a = E("a")
f = F("f")
d = G("d")
c = H("c")

i.u = j
n.q = i
n.z = i
n.r = j
n.o = c
j.z = a
j.w = a
j.o = f
b.r = f
b.y = j
b.v = d
a.w = d
a.y = c
f.q = d
f.u = d
f.r = a
f.p = b
f.t = i
d.x = b
d.t = b
d.s = n
d.u = j
d.y = j
d.p = c
d.z = a
d.v = a
c.o = j
c.x = f
assert d.u.o.t.u.o.t.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: C = None
        self.z: A = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: F = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: C = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: E = None
        self.u: G = None
        self.p: D = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: F = None
        self.txt = txt

i = A("i")
n = B("n")
j = C("j")
b = D("b")
a = E("a")
f = F("f")
d = G("d")
c = H("c")

i.u = j
n.q = i
n.z = i
n.r = j
n.o = c
j.z = a
j.w = a
j.o = f
b.r = f
b.y = j
b.v = d
a.w = d
a.y = c
f.q = d
f.u = d
f.r = a
f.p = b
f.t = i
d.x = b
d.t = b
d.s = n
d.u = j
d.y = j
d.p = c
d.z = a
d.v = a
c.o = j
c.x = f
assert d.u.o.t.u.o.t.u.z.txt == "a"