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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: E = None
        self.q: G = None
        self.t: D = None
        self.y: E = None
        self.w: A = None
        self.s: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: E = None
        self.q: G = None
        self.t: D = None
        self.y: E = None
        self.w: A = None
        self.s: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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