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

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

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

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

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

n = A("n")
a = B("a")
g = C("g")
k = D("k")
m = E("m")
l = E("l")
i = C("i")
e = A("e")
b = D("b")

n.t = k
a.o = g
a.r = m
g.w = l
g.u = i
k.o = e
k.y = b
m.y = g
m.q = n
m.r = n
m.p = n
l.y = g
l.q = n
l.r = e
l.p = e
i.w = m
i.u = g
e.t = b
b.o = e
b.y = k
assert b.o.t.y.o.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

n = A("n")
a = B("a")
g = C("g")
k = D("k")
m = E("m")
l = E("l")
i = C("i")
e = A("e")
b = D("b")

n.t = k
a.o = g
a.r = m
g.w = l
g.u = i
k.o = e
k.y = b
m.y = g
m.q = n
m.r = n
m.p = n
l.y = g
l.q = n
l.r = e
l.p = e
i.w = m
i.u = g
e.t = b
b.o = e
b.y = k
assert b.o.t.y.o.t.o.txt == "e"