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

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

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

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

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

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

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

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

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

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

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

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

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

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

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