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

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

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: G = None
        self.x: C = None
        self.s: F = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: G = None
        self.x: C = None
        self.s: F = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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