class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: G = None
        self.o: A = None
        self.x: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: G = None
        self.x: C = None
        self.z: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: G = None
        self.u: E = None
        self.v: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: G = None
        self.o: A = None
        self.x: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: G = None
        self.x: C = None
        self.z: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: G = None
        self.u: E = None
        self.v: E = None
        self.txt = txt

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

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