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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: C = None
        self.t: E = None
        self.p: A = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: C = None
        self.t: E = None
        self.p: A = None
        self.q: C = None
        self.txt = txt

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

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

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

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