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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: C = None
        self.s: D = None
        self.o: B = None
        self.txt = txt

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

m = A("m")
g = B("g")
i = C("i")
b = D("b")
c = E("c")
f = F("f")
a = F("a")
n = A("n")
l = B("l")
k = B("k")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: C = None
        self.s: D = None
        self.o: B = None
        self.txt = txt

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

m = A("m")
g = B("g")
i = C("i")
b = D("b")
c = E("c")
f = F("f")
a = F("a")
n = A("n")
l = B("l")
k = B("k")

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