class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: E = None
        self.v: C = None
        self.z: G = None
        self.x: F = None
        self.u: G = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: G = None
        self.txt = txt

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

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

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