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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: E = None
        self.v: D = None
        self.p: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

c = A("c")
a = B("a")
l = C("l")
g = D("g")
k = E("k")
n = D("n")
b = C("b")

c.t = l
a.t = g
a.y = k
a.v = n
a.p = b
l.v = a
l.t = b
l.q = n
g.u = l
g.s = n
k.w = a
k.o = a
k.y = b
n.u = l
n.s = g
b.v = a
b.t = l
b.q = g
assert k.y.q.u.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: E = None
        self.v: D = None
        self.p: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

c = A("c")
a = B("a")
l = C("l")
g = D("g")
k = E("k")
n = D("n")
b = C("b")

c.t = l
a.t = g
a.y = k
a.v = n
a.p = b
l.v = a
l.t = b
l.q = n
g.u = l
g.s = n
k.w = a
k.o = a
k.y = b
n.u = l
n.s = g
b.v = a
b.t = l
b.q = g
assert k.y.q.u.t.t.t.txt == "b"