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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: E = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: F = None
        self.t: F = None
        self.v: H = None
        self.y: D = None
        self.r: G = None
        self.p: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: E = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: F = None
        self.t: F = None
        self.v: H = None
        self.y: D = None
        self.r: G = None
        self.p: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: D = None
        self.txt = txt

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

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

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