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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: A = None
        self.t: D = None
        self.r: B = None
        self.w: D = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: F = None
        self.r: F = None
        self.x: F = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: F = None
        self.x: F = None
        self.o: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: A = None
        self.t: D = None
        self.r: B = None
        self.w: D = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: F = None
        self.r: F = None
        self.x: F = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: F = None
        self.x: F = None
        self.o: C = None
        self.txt = txt

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

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

f.w = b
f.q = e
k.y = f
k.x = m
k.q = m
k.z = n
k.t = b
m.q = f
m.x = f
m.t = i
m.r = k
m.w = n
m.p = n
n.s = e
n.w = b
n.r = b
n.x = b
n.y = m
e.q = m
e.o = m
e.u = b
e.x = b
b.t = k
b.w = k
i.s = e
i.w = b
i.r = b
i.x = b
i.y = m
assert k.t.w.q.t.y.t.y.txt == "m"