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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: D = None
        self.w: F = None
        self.u: D = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: E = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: B = None
        self.r: A = None
        self.p: F = None
        self.s: E = None
        self.w: C = None
        self.txt = txt

c = A("c")
d = B("d")
f = C("f")
e = D("e")
n = E("n")
m = F("m")
j = B("j")
k = F("k")
i = D("i")

c.y = d
c.q = f
d.q = i
d.o = c
d.t = f
f.x = i
f.v = i
f.u = i
f.p = i
f.w = m
e.z = i
e.w = n
e.v = n
n.x = e
n.z = e
m.x = k
m.p = k
m.o = d
m.r = c
m.s = n
m.w = f
j.q = i
j.o = c
j.t = f
k.x = m
k.p = m
k.o = d
k.r = c
k.s = n
k.w = f
i.z = e
i.w = n
i.v = n
assert i.z.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: D = None
        self.w: F = None
        self.u: D = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: E = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: B = None
        self.r: A = None
        self.p: F = None
        self.s: E = None
        self.w: C = None
        self.txt = txt

c = A("c")
d = B("d")
f = C("f")
e = D("e")
n = E("n")
m = F("m")
j = B("j")
k = F("k")
i = D("i")

c.y = d
c.q = f
d.q = i
d.o = c
d.t = f
f.x = i
f.v = i
f.u = i
f.p = i
f.w = m
e.z = i
e.w = n
e.v = n
n.x = e
n.z = e
m.x = k
m.p = k
m.o = d
m.r = c
m.s = n
m.w = f
j.q = i
j.o = c
j.t = f
k.x = m
k.p = m
k.o = d
k.r = c
k.s = n
k.w = f
i.z = e
i.w = n
i.v = n
assert i.z.z.w.txt == "n"