class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: D = None
        self.w: H = None
        self.z: F = None
        self.s: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: E = None
        self.w: G = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: G = None
        self.u: H = None
        self.r: H = None
        self.s: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

h = A("h")
e = B("e")
c = C("c")
g = D("g")
n = E("n")
i = F("i")
j = G("j")
m = H("m")

h.x = e
h.q = g
h.w = m
h.s = m
h.z = i
e.u = m
e.o = h
e.q = h
e.s = h
c.x = m
c.t = n
c.p = n
c.w = j
g.y = j
g.t = n
n.y = m
n.u = m
n.r = m
n.x = j
n.s = i
i.x = j
j.s = c
j.o = h
m.x = h
assert j.s.w.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: D = None
        self.w: H = None
        self.z: F = None
        self.s: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: E = None
        self.w: G = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: G = None
        self.u: H = None
        self.r: H = None
        self.s: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

h = A("h")
e = B("e")
c = C("c")
g = D("g")
n = E("n")
i = F("i")
j = G("j")
m = H("m")

h.x = e
h.q = g
h.w = m
h.s = m
h.z = i
e.u = m
e.o = h
e.q = h
e.s = h
c.x = m
c.t = n
c.p = n
c.w = j
g.y = j
g.t = n
n.y = m
n.u = m
n.r = m
n.x = j
n.s = i
i.x = j
j.s = c
j.o = h
m.x = h
assert j.s.w.o.w.txt == "m"