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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: A = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: G = None
        self.w: C = None
        self.o: F = None
        self.p: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: H = None
        self.s: H = None
        self.z: B = None
        self.u: E = None
        self.v: B = None
        self.t: A = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: C = None
        self.s: E = None
        self.v: C = None
        self.o: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: A = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: G = None
        self.w: C = None
        self.o: F = None
        self.p: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: H = None
        self.s: H = None
        self.z: B = None
        self.u: E = None
        self.v: B = None
        self.t: A = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: C = None
        self.s: E = None
        self.v: C = None
        self.o: G = None
        self.txt = txt

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

a.q = k
a.p = k
a.w = k
a.r = b
k.p = e
k.u = a
k.o = d
h.x = e
d.q = b
d.t = b
d.w = h
d.p = h
d.o = i
l.u = a
i.s = l
i.y = h
b.x = l
b.u = l
b.w = e
b.s = e
b.z = k
b.v = k
b.t = a
b.r = a
e.y = i
e.t = h
e.v = h
e.s = l
e.o = b
assert h.x.o.t.p.u.txt == "a"