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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: E = None
        self.u: A = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: E = None
        self.u: A = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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