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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: F = None
        self.v: A = None
        self.t: C = None
        self.w: F = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: D = None
        self.t: A = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: G = None
        self.s: C = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: C = None
        self.z: H = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: F = None
        self.v: A = None
        self.t: C = None
        self.w: F = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: D = None
        self.t: A = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: G = None
        self.s: C = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: C = None
        self.z: H = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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