class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: B = None
        self.t: H = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: D = None
        self.x: C = None
        self.z: H = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: G = None
        self.t: G = None
        self.q: D = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: A = None
        self.u: D = None
        self.t: C = None
        self.v: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: D = None
        self.x: C = None
        self.z: H = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: G = None
        self.t: G = None
        self.q: D = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: A = None
        self.u: D = None
        self.t: C = None
        self.v: B = None
        self.txt = txt

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

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

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

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