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

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

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

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

n = A("n")
g = B("g")
c = C("c")
f = D("f")
e = B("e")
d = D("d")
b = A("b")
l = D("l")
a = A("a")

n.z = l
n.v = l
n.x = e
n.o = g
g.u = c
g.r = l
g.y = e
c.p = g
c.r = l
c.z = n
c.o = n
f.v = g
f.w = c
f.y = c
e.u = c
e.r = d
e.y = g
d.v = g
d.w = c
d.y = c
b.z = l
b.x = e
b.o = e
b.v = d
l.v = g
l.w = c
l.y = c
a.z = f
a.v = f
a.x = g
a.o = e
assert c.r.v.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: B = None
        self.v: D = None
        self.o: B = None
        self.txt = txt

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

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

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

n = A("n")
g = B("g")
c = C("c")
f = D("f")
e = B("e")
d = D("d")
b = A("b")
l = D("l")
a = A("a")

n.z = l
n.v = l
n.x = e
n.o = g
g.u = c
g.r = l
g.y = e
c.p = g
c.r = l
c.z = n
c.o = n
f.v = g
f.w = c
f.y = c
e.u = c
e.r = d
e.y = g
d.v = g
d.w = c
d.y = c
b.z = l
b.x = e
b.o = e
b.v = d
l.v = g
l.w = c
l.y = c
a.z = f
a.v = f
a.x = g
a.o = e
assert c.r.v.r.y.txt == "c"