class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: D = None
        self.u: G = None
        self.y: C = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: A = None
        self.u: B = None
        self.s: E = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: B = None
        self.z: F = None
        self.r: A = None
        self.s: H = None
        self.p: H = None
        self.u: C = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: A = None
        self.q: B = None
        self.u: G = None
        self.w: G = None
        self.x: G = None
        self.txt = txt

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

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

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

d = A("d")
h = B("h")
g = C("g")
n = D("n")
a = E("a")
e = F("e")
b = G("b")
l = H("l")
c = D("c")
k = B("k")

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: A = None
        self.u: B = None
        self.s: E = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: B = None
        self.z: F = None
        self.r: A = None
        self.s: H = None
        self.p: H = None
        self.u: C = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: A = None
        self.q: B = None
        self.u: G = None
        self.w: G = None
        self.x: G = None
        self.txt = txt

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

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

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

d = A("d")
h = B("h")
g = C("g")
n = D("n")
a = E("a")
e = F("e")
b = G("b")
l = H("l")
c = D("c")
k = B("k")

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