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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: F = None
        self.y: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: B = None
        self.w: G = None
        self.x: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: F = None
        self.y: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: B = None
        self.w: G = None
        self.x: G = None
        self.txt = txt

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

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