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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: H = None
        self.o: H = None
        self.p: E = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: F = None
        self.q: D = None
        self.p: F = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: C = None
        self.v: D = None
        self.q: H = None
        self.r: H = None
        self.w: D = None
        self.p: G = None
        self.txt = txt

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

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

e = A("e")
d = B("d")
a = C("a")
f = D("f")
g = E("g")
b = F("b")
i = G("i")
j = H("j")

e.x = j
e.w = j
e.u = b
e.o = f
d.y = a
d.z = j
d.o = j
d.q = j
d.p = g
a.u = g
a.v = g
a.z = b
a.p = b
a.q = f
f.s = d
f.r = a
g.w = b
g.y = d
b.s = e
b.o = a
b.v = f
b.w = f
b.q = j
b.r = j
b.p = i
i.t = e
j.s = g
j.q = g
j.r = f
j.y = e
assert j.y.w.y.u.r.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: F = None
        self.w: H = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: H = None
        self.o: H = None
        self.p: E = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: F = None
        self.q: D = None
        self.p: F = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: C = None
        self.v: D = None
        self.q: H = None
        self.r: H = None
        self.w: D = None
        self.p: G = None
        self.txt = txt

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

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

e = A("e")
d = B("d")
a = C("a")
f = D("f")
g = E("g")
b = F("b")
i = G("i")
j = H("j")

e.x = j
e.w = j
e.u = b
e.o = f
d.y = a
d.z = j
d.o = j
d.q = j
d.p = g
a.u = g
a.v = g
a.z = b
a.p = b
a.q = f
f.s = d
f.r = a
g.w = b
g.y = d
b.s = e
b.o = a
b.v = f
b.w = f
b.q = j
b.r = j
b.p = i
i.t = e
j.s = g
j.q = g
j.r = f
j.y = e
assert j.y.w.y.u.r.q.y.txt == "d"