class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: D = None
        self.t: D = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: B = None
        self.p: F = None
        self.x: C = None
        self.u: C = None
        self.r: C = None
        self.w: A = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: D = None
        self.y: E = None
        self.x: G = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: G = None
        self.p: D = None
        self.x: G = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: D = None
        self.t: D = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: B = None
        self.p: F = None
        self.x: C = None
        self.u: C = None
        self.r: C = None
        self.w: A = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: D = None
        self.y: E = None
        self.x: G = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: G = None
        self.p: D = None
        self.x: G = None
        self.t: E = None
        self.txt = txt

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

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

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

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