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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: A = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: A = None
        self.w: F = None
        self.txt = txt

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

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

m.q = d
f.s = j
f.o = m
f.y = d
g.w = f
g.s = n
g.p = i
g.x = d
g.z = d
n.x = i
n.s = g
n.z = f
i.r = m
i.t = m
i.w = a
j.y = m
j.q = n
j.o = n
d.w = f
d.s = n
d.p = i
d.x = g
d.z = g
b.y = m
b.q = n
b.o = n
l.y = m
l.q = n
l.o = n
a.y = m
a.q = n
a.o = n
assert j.o.z.o.txt == "m"