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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.v: F = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.v: F = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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