class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: E = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: C = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: D = None
        self.t: G = None
        self.x: G = None
        self.u: F = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: A = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: E = None
        self.s: G = None
        self.z: G = None
        self.q: E = None
        self.u: B = None
        self.txt = txt

f = A("f")
l = B("l")
e = C("e")
j = D("j")
d = E("d")
a = F("a")
b = G("b")
k = H("k")

f.q = j
f.s = d
f.z = d
l.s = e
l.p = e
l.o = k
e.v = f
e.q = j
e.t = b
e.x = b
e.u = a
e.y = d
j.z = l
j.v = f
j.s = b
d.q = f
d.t = b
a.t = b
b.p = l
k.o = a
k.x = d
k.q = d
k.s = b
k.z = b
k.u = l
assert k.o.t.p.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: E = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: C = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: D = None
        self.t: G = None
        self.x: G = None
        self.u: F = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: A = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: E = None
        self.s: G = None
        self.z: G = None
        self.q: E = None
        self.u: B = None
        self.txt = txt

f = A("f")
l = B("l")
e = C("e")
j = D("j")
d = E("d")
a = F("a")
b = G("b")
k = H("k")

f.q = j
f.s = d
f.z = d
l.s = e
l.p = e
l.o = k
e.v = f
e.q = j
e.t = b
e.x = b
e.u = a
e.y = d
j.z = l
j.v = f
j.s = b
d.q = f
d.t = b
a.t = b
b.p = l
k.o = a
k.x = d
k.q = d
k.s = b
k.z = b
k.u = l
assert k.o.t.p.s.u.txt == "a"