class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: E = None
        self.z: C = None
        self.v: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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