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

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

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

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

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

a = A("a")
c = B("c")
i = C("i")
g = D("g")
e = E("e")
l = E("l")
d = D("d")

a.y = g
a.s = g
a.r = c
a.x = i
c.t = d
c.q = l
c.z = l
c.w = a
c.u = i
i.u = a
i.s = g
i.r = c
g.t = i
g.q = i
g.p = i
e.u = a
e.t = g
l.u = a
l.t = d
d.t = i
d.q = i
d.p = i
assert c.t.q.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.r: B = None
        self.x: C = None
        self.txt = txt

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

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

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

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

a = A("a")
c = B("c")
i = C("i")
g = D("g")
e = E("e")
l = E("l")
d = D("d")

a.y = g
a.s = g
a.r = c
a.x = i
c.t = d
c.q = l
c.z = l
c.w = a
c.u = i
i.u = a
i.s = g
i.r = c
g.t = i
g.q = i
g.p = i
e.u = a
e.t = g
l.u = a
l.t = d
d.t = i
d.q = i
d.p = i
assert c.t.q.r.t.txt == "d"