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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: A = None
        self.q: E = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: A = None
        self.q: E = None
        self.u: G = None
        self.txt = txt

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

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