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

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

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

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

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

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

c = A("c")
f = B("f")
e = C("e")
b = D("b")
n = E("n")
d = F("d")
l = A("l")

c.y = e
c.q = e
c.s = e
c.u = e
c.x = d
c.t = d
f.o = d
f.w = n
f.v = n
f.q = l
e.w = f
e.v = n
e.p = n
e.u = c
e.x = b
b.s = n
n.p = d
n.w = d
n.r = f
n.t = e
d.v = n
d.w = n
d.q = l
d.o = l
d.u = f
l.y = e
l.q = e
l.s = e
l.u = e
l.x = d
l.t = d
assert n.w.q.t.o.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: F = None
        self.t: F = None
        self.q: C = None
        self.s: C = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

c = A("c")
f = B("f")
e = C("e")
b = D("b")
n = E("n")
d = F("d")
l = A("l")

c.y = e
c.q = e
c.s = e
c.u = e
c.x = d
c.t = d
f.o = d
f.w = n
f.v = n
f.q = l
e.w = f
e.v = n
e.p = n
e.u = c
e.x = b
b.s = n
n.p = d
n.w = d
n.r = f
n.t = e
d.v = n
d.w = n
d.q = l
d.o = l
d.u = f
l.y = e
l.q = e
l.s = e
l.u = e
l.x = d
l.t = d
assert n.w.q.t.o.t.u.txt == "f"