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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

b = A("b")
g = B("g")
k = C("k")
l = D("l")
i = A("i")
j = D("j")
f = B("f")
n = C("n")
c = C("c")

b.u = c
b.q = j
b.z = i
g.x = n
g.v = c
g.y = j
k.t = l
k.v = l
l.v = b
i.u = k
i.q = j
i.z = b
j.v = b
f.x = k
f.v = k
f.y = l
n.t = l
n.v = l
c.t = j
c.v = j
assert g.v.v.v.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: D = None
        self.z: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

b = A("b")
g = B("g")
k = C("k")
l = D("l")
i = A("i")
j = D("j")
f = B("f")
n = C("n")
c = C("c")

b.u = c
b.q = j
b.z = i
g.x = n
g.v = c
g.y = j
k.t = l
k.v = l
l.v = b
i.u = k
i.q = j
i.z = b
j.v = b
f.x = k
f.v = k
f.y = l
n.t = l
n.v = l
c.t = j
c.v = j
assert g.v.v.v.z.z.txt == "b"