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

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

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

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

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

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

a.s = l
i.p = l
i.o = a
j.p = i
j.v = i
j.s = a
j.q = e
j.x = l
g.p = e
g.z = e
g.r = e
g.s = n
c.v = j
c.u = g
c.w = n
l.p = n
l.v = i
l.s = a
l.q = e
l.x = j
n.p = j
n.o = a
b.v = l
b.u = e
b.w = n
e.p = g
e.z = g
e.r = g
e.s = n
assert g.p.s.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

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

a.s = l
i.p = l
i.o = a
j.p = i
j.v = i
j.s = a
j.q = e
j.x = l
g.p = e
g.z = e
g.r = e
g.s = n
c.v = j
c.u = g
c.w = n
l.p = n
l.v = i
l.s = a
l.q = e
l.x = j
n.p = j
n.o = a
b.v = l
b.u = e
b.w = n
e.p = g
e.z = g
e.r = g
e.s = n
assert g.p.s.p.s.txt == "a"