class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: C = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: C = None
        self.t: C = None
        self.v: B = None
        self.p: F = None
        self.r: H = None
        self.o: H = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: D = None
        self.r: G = None
        self.z: A = None
        self.q: G = None
        self.y: C = None
        self.x: B = None
        self.t: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: C = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: C = None
        self.t: C = None
        self.v: B = None
        self.p: F = None
        self.r: H = None
        self.o: H = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: D = None
        self.r: G = None
        self.z: A = None
        self.q: G = None
        self.y: C = None
        self.x: B = None
        self.t: A = None
        self.txt = txt

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

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

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

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