class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: F = None
        self.x: E = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.r: A = None
        self.t: G = None
        self.s: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: G = None
        self.o: D = None
        self.z: B = None
        self.w: C = None
        self.x: B = None
        self.q: C = None
        self.txt = txt

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

b.r = k
b.x = k
b.t = g
b.y = h
a.q = g
a.x = k
a.z = k
a.t = e
a.o = d
a.p = j
h.y = e
h.s = e
h.o = a
h.r = b
h.t = d
e.y = d
e.r = j
e.u = h
e.t = g
k.p = g
k.t = e
k.v = d
g.u = e
d.o = e
j.v = b
j.y = d
j.o = e
j.z = a
j.x = a
j.w = h
j.q = h
assert a.q.u.u.y.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: F = None
        self.x: E = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.r: A = None
        self.t: G = None
        self.s: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: G = None
        self.o: D = None
        self.z: B = None
        self.w: C = None
        self.x: B = None
        self.q: C = None
        self.txt = txt

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

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