class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: E = None
        self.q: H = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: H = None
        self.v: F = None
        self.t: A = None
        self.w: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: F = None
        self.txt = txt

i = A("i")
l = B("l")
m = C("m")
a = D("a")
d = E("d")
h = F("h")
b = G("b")
n = H("n")

i.v = a
i.r = d
i.x = d
i.q = n
l.t = n
m.q = i
m.t = i
m.r = a
a.x = n
a.u = n
a.v = h
a.t = i
a.w = d
d.s = n
h.u = d
h.s = b
b.r = a
n.q = h
n.w = h
assert i.x.s.w.u.s.w.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: E = None
        self.q: H = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: H = None
        self.v: F = None
        self.t: A = None
        self.w: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: F = None
        self.txt = txt

i = A("i")
l = B("l")
m = C("m")
a = D("a")
d = E("d")
h = F("h")
b = G("b")
n = H("n")

i.v = a
i.r = d
i.x = d
i.q = n
l.t = n
m.q = i
m.t = i
m.r = a
a.x = n
a.u = n
a.v = h
a.t = i
a.w = d
d.s = n
h.u = d
h.s = b
b.r = a
n.q = h
n.w = h
assert i.x.s.w.u.s.w.s.r.txt == "a"