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

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

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

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

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

d = A("d")
n = B("n")
g = C("g")
a = D("a")
k = E("k")
f = B("f")
i = A("i")
c = C("c")

d.z = i
d.p = i
d.t = i
d.o = g
d.w = k
n.p = a
n.x = a
n.v = f
g.t = k
g.q = c
g.u = a
g.x = f
g.w = d
a.y = k
a.u = i
k.p = n
k.t = f
k.v = i
k.q = i
f.p = a
f.x = a
f.v = n
i.z = d
i.p = d
i.t = d
i.o = g
i.w = k
c.t = k
c.q = g
c.u = a
c.x = f
c.w = d
assert d.p.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.o: C = None
        self.w: E = None
        self.t: A = None
        self.txt = txt

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

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

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

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

d = A("d")
n = B("n")
g = C("g")
a = D("a")
k = E("k")
f = B("f")
i = A("i")
c = C("c")

d.z = i
d.p = i
d.t = i
d.o = g
d.w = k
n.p = a
n.x = a
n.v = f
g.t = k
g.q = c
g.u = a
g.x = f
g.w = d
a.y = k
a.u = i
k.p = n
k.t = f
k.v = i
k.q = i
f.p = a
f.x = a
f.v = n
i.z = d
i.p = d
i.t = d
i.o = g
i.w = k
c.t = k
c.q = g
c.u = a
c.x = f
c.w = d
assert d.p.p.p.txt == "i"