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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: D = None
        self.w: F = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: C = None
        self.y: F = None
        self.txt = txt

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

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

m.o = b
i.z = b
i.w = m
i.x = m
i.o = f
a.y = i
a.o = j
a.t = j
a.w = b
j.u = i
f.v = j
f.u = a
f.y = b
b.t = i
e.v = j
e.u = a
e.y = b
assert e.v.u.w.o.t.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: D = None
        self.w: F = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: C = None
        self.y: F = None
        self.txt = txt

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

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

m.o = b
i.z = b
i.w = m
i.x = m
i.o = f
a.y = i
a.o = j
a.t = j
a.w = b
j.u = i
f.v = j
f.u = a
f.y = b
b.t = i
e.v = j
e.u = a
e.y = b
assert e.v.u.w.o.t.o.v.txt == "j"