class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

i = A("i")
j = B("j")
c = C("c")
g = D("g")
h = E("h")
d = D("d")
e = E("e")

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

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

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

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

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

i = A("i")
j = B("j")
c = C("c")
g = D("g")
h = E("h")
d = D("d")
e = E("e")

i.q = e
i.r = e
i.x = h
j.p = i
j.o = d
j.u = h
c.q = j
c.p = d
c.r = i
g.u = h
g.o = i
g.y = c
g.r = d
g.t = j
h.z = i
h.v = j
h.t = j
h.o = j
d.u = e
d.o = i
d.y = c
d.r = g
d.t = j
e.z = i
e.v = j
e.t = j
e.o = j
assert d.r.r.r.y.p.txt == "d"