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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: F = None
        self.w: F = None
        self.p: A = None
        self.z: B = None
        self.q: E = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: A = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: A = None
        self.u: G = None
        self.r: E = None
        self.o: D = None
        self.t: C = None
        self.w: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: F = None
        self.w: F = None
        self.p: A = None
        self.z: B = None
        self.q: E = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: A = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: A = None
        self.u: G = None
        self.r: E = None
        self.o: D = None
        self.t: C = None
        self.w: F = None
        self.txt = txt

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

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

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