class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: E = None
        self.r: E = None
        self.o: A = None
        self.txt = txt

c = A("c")
l = B("l")
d = C("d")
n = D("n")
e = E("e")
a = F("a")
b = B("b")
j = B("j")
m = F("m")

c.w = e
l.o = n
d.x = n
d.z = l
n.u = b
n.t = a
n.v = a
n.r = m
n.p = e
n.z = c
e.x = c
e.o = c
e.z = n
a.s = c
a.o = c
a.v = e
a.r = e
b.o = n
j.o = n
m.s = c
m.o = c
m.v = e
m.r = e
assert a.o.w.o.w.z.t.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: E = None
        self.r: E = None
        self.o: A = None
        self.txt = txt

c = A("c")
l = B("l")
d = C("d")
n = D("n")
e = E("e")
a = F("a")
b = B("b")
j = B("j")
m = F("m")

c.w = e
l.o = n
d.x = n
d.z = l
n.u = b
n.t = a
n.v = a
n.r = m
n.p = e
n.z = c
e.x = c
e.o = c
e.z = n
a.s = c
a.o = c
a.v = e
a.r = e
b.o = n
j.o = n
m.s = c
m.o = c
m.v = e
m.r = e
assert a.o.w.o.w.z.t.v.z.txt == "n"