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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: G = None
        self.p: C = None
        self.s: F = None
        self.z: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: G = None
        self.p: C = None
        self.s: F = None
        self.z: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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