class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

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

l = A("l")
g = B("g")
k = C("k")
f = D("f")
a = E("a")
j = E("j")
h = D("h")
c = B("c")

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

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

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

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

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

l = A("l")
g = B("g")
k = C("k")
f = D("f")
a = E("a")
j = E("j")
h = D("h")
c = B("c")

l.y = c
g.r = a
g.u = a
g.p = k
g.v = k
g.q = f
k.o = f
f.z = k
f.o = k
f.r = l
a.t = k
a.x = l
j.t = k
j.x = l
h.z = k
h.o = k
h.r = l
c.r = a
c.u = a
c.p = k
c.v = k
c.q = f
assert c.u.t.o.r.y.txt == "c"