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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: D = None
        self.q: C = None
        self.r: F = None
        self.u: E = None
        self.o: D = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: D = None
        self.z: G = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: C = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: D = None
        self.w: H = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: A = None
        self.t: B = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: D = None
        self.q: C = None
        self.r: F = None
        self.u: E = None
        self.o: D = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: D = None
        self.z: G = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: C = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: D = None
        self.w: H = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: A = None
        self.t: B = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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