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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: C = None
        self.v: A = None
        self.o: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: C = None
        self.v: A = None
        self.o: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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