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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: D = None
        self.z: B = None
        self.q: E = None
        self.txt = txt

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

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

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

d.t = j
d.w = l
d.p = a
d.r = i
i.x = d
l.w = j
l.q = j
l.y = c
l.z = i
c.r = n
c.z = n
c.p = i
j.v = b
j.w = b
j.p = b
j.t = d
j.q = a
h.r = n
h.z = d
h.p = i
n.t = j
n.w = l
n.p = a
n.r = i
a.t = j
a.w = l
a.p = n
a.r = i
b.r = d
b.z = a
b.p = i
assert l.q.q.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: C = None
        self.p: A = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: D = None
        self.z: B = None
        self.q: E = None
        self.txt = txt

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

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

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

d.t = j
d.w = l
d.p = a
d.r = i
i.x = d
l.w = j
l.q = j
l.y = c
l.z = i
c.r = n
c.z = n
c.p = i
j.v = b
j.w = b
j.p = b
j.t = d
j.q = a
h.r = n
h.z = d
h.p = i
n.t = j
n.w = l
n.p = a
n.r = i
a.t = j
a.w = l
a.p = n
a.r = i
b.r = d
b.z = a
b.p = i
assert l.q.q.r.x.txt == "d"