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

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

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

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

e = A("e")
k = B("k")
c = C("c")
a = D("a")
d = B("d")
m = A("m")
f = A("f")
n = C("n")

e.v = a
e.q = f
e.u = f
e.p = f
k.r = a
k.x = d
k.v = d
k.z = f
c.v = n
c.r = n
a.u = k
a.t = k
a.s = k
a.z = m
d.r = a
d.x = k
d.v = k
d.z = f
m.v = a
m.q = f
m.u = f
m.p = f
f.v = a
f.q = e
f.u = m
f.p = m
n.v = c
n.r = c
assert c.r.r.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.u: A = None
        self.p: A = None
        self.txt = txt

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

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

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

e = A("e")
k = B("k")
c = C("c")
a = D("a")
d = B("d")
m = A("m")
f = A("f")
n = C("n")

e.v = a
e.q = f
e.u = f
e.p = f
k.r = a
k.x = d
k.v = d
k.z = f
c.v = n
c.r = n
a.u = k
a.t = k
a.s = k
a.z = m
d.r = a
d.x = k
d.v = k
d.z = f
m.v = a
m.q = f
m.u = f
m.p = f
f.v = a
f.q = e
f.u = m
f.p = m
n.v = c
n.r = c
assert c.r.r.v.r.txt == "c"