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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: E = None
        self.q: A = None
        self.u: B = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: G = None
        self.t: A = None
        self.u: B = None
        self.txt = txt

h = A("h")
e = B("e")
i = C("i")
a = D("a")
j = E("j")
m = F("m")
n = G("n")
k = H("k")

h.u = i
h.o = m
h.y = e
h.p = e
e.u = k
i.o = n
i.p = j
i.q = h
i.u = e
i.v = k
a.q = i
a.t = m
a.r = m
a.s = k
a.o = k
a.z = e
a.x = h
j.v = m
m.x = h
m.p = h
m.z = n
n.p = h
k.p = i
k.q = n
k.t = h
k.u = e
assert a.x.y.u.u.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: F = None
        self.y: B = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: E = None
        self.q: A = None
        self.u: B = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: G = None
        self.t: A = None
        self.u: B = None
        self.txt = txt

h = A("h")
e = B("e")
i = C("i")
a = D("a")
j = E("j")
m = F("m")
n = G("n")
k = H("k")

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