class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: D = None
        self.t: C = None
        self.x: D = None
        self.o: C = None
        self.p: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: C = None
        self.s: A = None
        self.txt = txt

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

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