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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: E = None
        self.w: A = None
        self.z: E = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: E = None
        self.w: A = None
        self.z: E = None
        self.r: B = None
        self.txt = txt

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

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

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