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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: E = None
        self.q: A = None
        self.t: F = None
        self.x: F = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: A = None
        self.p: F = None
        self.w: F = None
        self.z: D = None
        self.txt = txt

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

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

l.w = f
l.t = e
l.v = m
i.y = l
e.v = b
b.u = e
b.s = f
b.z = f
b.q = l
b.t = m
b.x = m
f.q = b
f.z = b
f.x = l
f.p = m
f.w = m
m.z = f
assert m.z.x.t.v.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: C = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: E = None
        self.q: A = None
        self.t: F = None
        self.x: F = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: A = None
        self.p: F = None
        self.w: F = None
        self.z: D = None
        self.txt = txt

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

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

l.w = f
l.t = e
l.v = m
i.y = l
e.v = b
b.u = e
b.s = f
b.z = f
b.q = l
b.t = m
b.x = m
f.q = b
f.z = b
f.x = l
f.p = m
f.w = m
m.z = f
assert m.z.x.t.v.x.z.txt == "f"