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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: A = None
        self.s: E = None
        self.z: A = None
        self.y: C = None
        self.o: B = None
        self.x: C = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.txt = txt

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

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

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

h.s = n
h.t = i
i.x = g
n.q = h
l.u = b
l.v = h
l.z = h
l.s = j
l.y = n
l.x = n
l.o = i
l.t = i
j.v = c
g.o = j
g.u = h
c.q = j
c.z = h
a.p = l
b.p = l
assert n.q.s.q.t.x.u.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: A = None
        self.s: E = None
        self.z: A = None
        self.y: C = None
        self.o: B = None
        self.x: C = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.txt = txt

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

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

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

h.s = n
h.t = i
i.x = g
n.q = h
l.u = b
l.v = h
l.z = h
l.s = j
l.y = n
l.x = n
l.o = i
l.t = i
j.v = c
g.o = j
g.u = h
c.q = j
c.z = h
a.p = l
b.p = l
assert n.q.s.q.t.x.u.s.q.txt == "h"