class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: C = None
        self.z: 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.q: D = None
        self.y: B = None
        self.v: D = None
        self.txt = txt

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

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

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

a.t = i
a.v = i
a.z = l
l.x = a
i.q = g
i.y = l
i.v = c
c.z = a
c.p = g
c.v = b
c.r = i
b.w = l
b.z = l
b.r = c
g.z = a
g.p = c
g.v = b
g.r = i
assert c.z.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: C = None
        self.z: 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.q: D = None
        self.y: B = None
        self.v: D = None
        self.txt = txt

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

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

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

a.t = i
a.v = i
a.z = l
l.x = a
i.q = g
i.y = l
i.v = c
c.z = a
c.p = g
c.v = b
c.r = i
b.w = l
b.z = l
b.r = c
g.z = a
g.p = c
g.v = b
g.r = i
assert c.z.z.x.txt == "a"