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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: B = None
        self.r: D = None
        self.v: B = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: F = None
        self.z: C = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: B = None
        self.r: D = None
        self.v: B = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: F = None
        self.z: C = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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