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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: B = None
        self.u: B = None
        self.t: A = None
        self.v: B = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: B = None
        self.u: B = None
        self.t: A = None
        self.v: B = None
        self.z: A = None
        self.txt = txt

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

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

m.s = a
m.w = i
m.x = i
i.t = m
i.s = j
e.o = a
c.o = m
k.w = h
k.x = i
k.u = i
k.v = i
k.t = m
k.z = m
f.r = c
f.q = c
a.o = m
h.r = a
h.q = c
j.o = a
assert a.o.w.s.o.o.s.o.w.t.txt == "m"