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

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: E = None
        self.x: C = None
        self.txt = txt

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

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

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

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

c.q = f
f.w = e
f.u = c
f.v = n
f.q = k
k.t = l
k.x = l
k.s = n
m.u = e
m.w = e
m.s = f
n.q = e
n.s = a
n.v = f
e.x = f
l.t = a
l.s = n
l.x = k
a.t = k
a.s = n
a.x = l
assert n.v.u.q.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: E = None
        self.x: C = None
        self.txt = txt

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

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

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

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

c.q = f
f.w = e
f.u = c
f.v = n
f.q = k
k.t = l
k.x = l
k.s = n
m.u = e
m.w = e
m.s = f
n.q = e
n.s = a
n.v = f
e.x = f
l.t = a
l.s = n
l.x = k
a.t = k
a.s = n
a.x = l
assert n.v.u.q.q.x.txt == "l"