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

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

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

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

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

k = A("k")
d = B("d")
c = C("c")
i = D("i")
b = E("b")
g = D("g")
e = C("e")

k.p = g
k.r = b
k.t = b
k.y = d
k.o = c
d.t = e
d.s = g
d.x = b
c.w = i
c.s = g
c.p = e
c.x = e
i.w = c
i.o = c
i.q = e
i.p = d
b.y = k
b.u = e
b.o = e
b.p = d
g.w = e
g.q = e
g.o = c
g.p = d
e.w = g
e.s = i
e.p = c
e.x = c
assert i.q.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: E = None
        self.y: B = None
        self.t: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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

k = A("k")
d = B("d")
c = C("c")
i = D("i")
b = E("b")
g = D("g")
e = C("e")

k.p = g
k.r = b
k.t = b
k.y = d
k.o = c
d.t = e
d.s = g
d.x = b
c.w = i
c.s = g
c.p = e
c.x = e
i.w = c
i.o = c
i.q = e
i.p = d
b.y = k
b.u = e
b.o = e
b.p = d
g.w = e
g.q = e
g.o = c
g.p = d
e.w = g
e.s = i
e.p = c
e.x = c
assert i.q.w.w.txt == "e"