class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: G = None
        self.y: I = None
        self.z: E = None
        self.v: H = None
        self.p: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: I = None
        self.z: B = None
        self.u: F = None
        self.x: D = None
        self.v: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: E = None
        self.q: B = None
        self.y: E = None
        self.txt = txt

d = A("d")
b = B("b")
g = C("g")
n = D("n")
h = E("h")
k = F("k")
a = G("a")
m = H("m")
c = I("c")
f = F("f")

d.s = n
d.v = n
b.p = a
g.x = n
n.p = b
h.x = b
k.w = f
k.x = a
k.y = c
k.z = h
k.v = m
k.p = d
a.y = b
a.z = b
a.o = n
a.v = n
a.w = d
a.p = d
a.r = m
a.x = m
m.s = k
m.t = c
m.z = b
m.u = f
m.x = n
m.v = g
c.u = d
c.z = h
c.y = h
c.q = b
f.w = k
f.x = a
f.y = c
f.z = h
f.v = m
f.p = d
assert c.z.x.p.z.p.p.v.p.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: G = None
        self.y: I = None
        self.z: E = None
        self.v: H = None
        self.p: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: I = None
        self.z: B = None
        self.u: F = None
        self.x: D = None
        self.v: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: E = None
        self.q: B = None
        self.y: E = None
        self.txt = txt

d = A("d")
b = B("b")
g = C("g")
n = D("n")
h = E("h")
k = F("k")
a = G("a")
m = H("m")
c = I("c")
f = F("f")

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