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

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

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

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

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

a = A("a")
i = B("i")
g = C("g")
h = D("h")
f = E("f")
k = B("k")
e = A("e")
l = E("l")

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

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

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

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

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

a = A("a")
i = B("i")
g = C("g")
h = D("h")
f = E("f")
k = B("k")
e = A("e")
l = E("l")

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