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

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

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

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

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

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

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

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

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

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

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

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

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

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

f.o = d
f.x = l
m.s = a
m.t = j
l.t = m
l.r = a
j.x = l
j.u = f
d.v = l
d.z = j
d.r = m
a.w = m
a.q = j
i.w = m
i.q = j
assert i.w.t.x.t.s.w.txt == "m"