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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.x: C = None
        self.p: D = None
        self.u: E = None
        self.z: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: D = None
        self.x: C = None
        self.r: A = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

d = A("d")
f = B("f")
c = C("c")
j = D("j")
m = E("m")
b = F("b")
i = F("i")
a = C("a")

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.x: C = None
        self.p: D = None
        self.u: E = None
        self.z: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: D = None
        self.x: C = None
        self.r: A = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

d = A("d")
f = B("f")
c = C("c")
j = D("j")
m = E("m")
b = F("b")
i = F("i")
a = C("a")

d.w = f
f.q = d
f.v = c
f.x = a
f.p = j
f.z = j
f.u = m
c.s = i
c.o = b
c.z = m
c.v = j
j.r = c
j.v = d
m.q = j
b.v = f
b.t = f
b.w = j
b.x = c
b.z = c
b.r = d
i.v = f
i.t = f
i.w = j
i.x = a
i.r = d
i.z = c
a.s = i
a.o = b
a.z = m
a.v = j
assert m.q.v.w.v.v.v.w.x.txt == "a"