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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: D = None
        self.t: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: E = None
        self.z: D = None
        self.y: D = None
        self.txt = txt

a = A("a")
d = B("d")
e = C("e")
i = D("i")
c = E("c")
m = F("m")
k = G("k")
j = H("j")

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: D = None
        self.t: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: E = None
        self.z: D = None
        self.y: D = None
        self.txt = txt

a = A("a")
d = B("d")
e = C("e")
i = D("i")
c = E("c")
m = F("m")
k = G("k")
j = H("j")

a.z = c
a.y = i
a.q = e
a.s = e
d.o = j
d.s = i
d.t = e
d.z = c
e.x = j
e.r = k
e.s = a
i.o = c
i.w = e
c.s = j
c.z = m
m.v = e
k.x = c
k.u = a
j.x = d
j.o = c
j.z = i
j.y = i
assert j.o.s.x.txt == "d"