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

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

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

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

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

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

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

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

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

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

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

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

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

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

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