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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: C = None
        self.y: E = None
        self.t: D = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: F = None
        self.v: F = None
        self.q: B = None
        self.s: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: C = None
        self.y: E = None
        self.t: D = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: F = None
        self.v: F = None
        self.q: B = None
        self.s: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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