class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: E = None
        self.txt = txt

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

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

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

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

j = A("j")
e = B("e")
n = C("n")
a = D("a")
c = E("c")
l = B("l")
g = B("g")
i = E("i")
f = D("f")

j.o = c
j.u = i
e.q = n
e.p = j
n.t = a
a.y = l
a.s = f
c.p = n
c.w = n
c.o = a
c.t = a
c.x = j
l.q = n
l.p = j
g.q = n
g.p = j
i.p = n
i.w = n
i.o = a
i.t = a
i.x = j
f.y = l
f.s = a
assert a.s.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: E = None
        self.txt = txt

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

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

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

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

j = A("j")
e = B("e")
n = C("n")
a = D("a")
c = E("c")
l = B("l")
g = B("g")
i = E("i")
f = D("f")

j.o = c
j.u = i
e.q = n
e.p = j
n.t = a
a.y = l
a.s = f
c.p = n
c.w = n
c.o = a
c.t = a
c.x = j
l.q = n
l.p = j
g.q = n
g.p = j
i.p = n
i.w = n
i.o = a
i.t = a
i.x = j
f.y = l
f.s = a
assert a.s.s.y.txt == "l"