class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: H = None
        self.p: F = None
        self.o: H = None
        self.z: C = None
        self.u: A = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: B = None
        self.z: G = None
        self.s: G = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: D = None
        self.r: F = None
        self.z: E = None
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: H = None
        self.p: F = None
        self.o: H = None
        self.z: C = None
        self.u: A = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: B = None
        self.z: G = None
        self.s: G = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: D = None
        self.r: F = None
        self.z: E = None
        self.u: A = None
        self.txt = txt

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

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