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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: E = None
        self.v: F = None
        self.txt = txt

f = A("f")
a = B("a")
l = C("l")
g = D("g")
m = E("m")
j = F("j")
d = E("d")
i = F("i")
e = D("e")

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: E = None
        self.v: F = None
        self.txt = txt

f = A("f")
a = B("a")
l = C("l")
g = D("g")
m = E("m")
j = F("j")
d = E("d")
i = F("i")
e = D("e")

f.q = l
f.s = a
a.v = m
a.u = i
a.s = g
a.z = g
a.p = j
l.s = e
g.s = a
g.o = m
m.v = j
m.q = j
m.w = d
m.r = g
j.p = i
j.v = i
j.x = d
d.v = i
d.q = i
d.w = m
d.r = g
i.p = j
i.v = j
i.x = m
e.s = a
e.o = d
assert a.v.w.w.txt == "m"