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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: C = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
k = C("k")
n = D("n")
a = D("a")
m = C("m")
i = A("i")
j = A("j")
f = D("f")

c.x = a
c.v = i
c.y = n
c.w = j
l.o = i
l.s = k
k.z = m
k.t = a
k.y = f
k.u = l
n.q = j
n.w = k
a.q = j
a.w = k
m.z = k
m.t = a
m.y = n
m.u = l
i.x = n
i.v = c
i.w = c
i.y = a
j.x = f
j.y = f
j.v = i
j.w = i
f.q = c
f.w = k
assert c.w.x.w.z.y.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: A = None
        self.y: D = None
        self.w: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: C = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
k = C("k")
n = D("n")
a = D("a")
m = C("m")
i = A("i")
j = A("j")
f = D("f")

c.x = a
c.v = i
c.y = n
c.w = j
l.o = i
l.s = k
k.z = m
k.t = a
k.y = f
k.u = l
n.q = j
n.w = k
a.q = j
a.w = k
m.z = k
m.t = a
m.y = n
m.u = l
i.x = n
i.v = c
i.w = c
i.y = a
j.x = f
j.y = f
j.v = i
j.w = i
f.q = c
f.w = k
assert c.w.x.w.z.y.q.y.txt == "f"