class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: G = None
        self.y: D = None
        self.r: C = None
        self.w: G = None
        self.s: D = None
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: C = None
        self.r: F = None
        self.z: G = None
        self.y: B = None
        self.w: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

j.z = e
j.y = e
j.s = e
j.q = a
j.w = a
j.r = b
j.x = n
l.q = b
l.z = a
b.v = j
b.r = j
e.s = m
n.v = b
n.x = b
n.u = b
n.r = m
n.z = a
n.y = l
n.w = l
m.y = a
a.t = n
i.r = l
assert m.y.t.v.r.q.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: G = None
        self.y: D = None
        self.r: C = None
        self.w: G = None
        self.s: D = None
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: C = None
        self.r: F = None
        self.z: G = None
        self.y: B = None
        self.w: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

j.z = e
j.y = e
j.s = e
j.q = a
j.w = a
j.r = b
j.x = n
l.q = b
l.z = a
b.v = j
b.r = j
e.s = m
n.v = b
n.x = b
n.u = b
n.r = m
n.z = a
n.y = l
n.w = l
m.y = a
a.t = n
i.r = l
assert m.y.t.v.r.q.t.r.txt == "m"