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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: A = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: A = None
        self.u: D = None
        self.txt = txt

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

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

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