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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: E = None
        self.t: B = None
        self.y: F = None
        self.s: E = None
        self.z: A = None
        self.txt = txt

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

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

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

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

b = A("b")
k = B("k")
d = C("d")
j = D("j")
i = E("i")
m = F("m")
h = B("h")
f = D("f")

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: E = None
        self.t: B = None
        self.y: F = None
        self.s: E = None
        self.z: A = None
        self.txt = txt

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

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

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

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

b = A("b")
k = B("k")
d = C("d")
j = D("j")
i = E("i")
m = F("m")
h = B("h")
f = D("f")

b.t = m
b.u = i
k.v = b
k.z = b
k.x = i
k.s = i
k.t = h
k.y = m
d.w = k
d.y = b
d.v = i
j.z = d
j.u = b
j.q = f
j.t = m
i.z = b
i.w = b
i.p = m
i.y = m
i.t = d
i.v = k
m.s = d
m.p = i
m.z = h
h.v = b
h.z = b
h.x = i
h.s = i
h.t = k
h.y = m
f.z = d
f.u = b
f.q = j
f.t = m
assert f.t.s.w.txt == "k"