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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: B = None
        self.w: F = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: B = None
        self.p: B = None
        self.s: A = None
        self.q: B = None
        self.x: D = None
        self.txt = txt

f = A("f")
e = B("e")
l = C("l")
n = D("n")
g = E("g")
h = F("h")
k = F("k")
j = C("j")
m = B("m")
a = E("a")

f.q = l
f.p = l
f.s = k
e.r = a
e.y = k
e.w = l
e.x = j
l.x = k
l.z = m
l.w = h
l.q = a
l.p = a
n.x = g
n.z = f
g.v = e
h.r = a
h.v = e
h.p = e
h.s = f
h.q = m
h.x = n
k.r = a
k.v = e
k.p = m
k.q = m
k.s = f
k.x = n
j.x = k
j.w = k
j.z = m
j.q = a
j.p = g
m.r = g
m.y = k
m.w = j
m.x = l
a.v = e
assert m.w.q.v.r.v.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: F = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: B = None
        self.w: F = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: B = None
        self.p: B = None
        self.s: A = None
        self.q: B = None
        self.x: D = None
        self.txt = txt

f = A("f")
e = B("e")
l = C("l")
n = D("n")
g = E("g")
h = F("h")
k = F("k")
j = C("j")
m = B("m")
a = E("a")

f.q = l
f.p = l
f.s = k
e.r = a
e.y = k
e.w = l
e.x = j
l.x = k
l.z = m
l.w = h
l.q = a
l.p = a
n.x = g
n.z = f
g.v = e
h.r = a
h.v = e
h.p = e
h.s = f
h.q = m
h.x = n
k.r = a
k.v = e
k.p = m
k.q = m
k.s = f
k.x = n
j.x = k
j.w = k
j.z = m
j.q = a
j.p = g
m.r = g
m.y = k
m.w = j
m.x = l
a.v = e
assert m.w.q.v.r.v.y.x.txt == "n"