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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: F = None
        self.p: C = None
        self.u: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: H = None
        self.x: D = None
        self.u: F = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: A = None
        self.o: A = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: F = None
        self.p: C = None
        self.u: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: H = None
        self.x: D = None
        self.u: F = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: A = None
        self.o: A = None
        self.t: E = None
        self.txt = txt

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

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