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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: B = None
        self.p: E = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: B = None
        self.p: E = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: C = None
        self.txt = txt

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

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

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