class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: F = None
        self.u: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: H = None
        self.p: C = None
        self.u: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: E = None
        self.o: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: F = None
        self.u: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: H = None
        self.p: C = None
        self.u: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: E = None
        self.o: G = None
        self.txt = txt

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

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