class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: C = None
        self.p: B = None
        self.r: B = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: G = None
        self.x: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: C = None
        self.t: C = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: B = None
        self.x: H = None
        self.txt = txt

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

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

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

c.o = f
c.p = f
c.r = f
c.s = l
c.z = l
f.z = l
f.x = l
f.r = i
l.q = d
d.y = c
d.z = h
m.z = d
m.q = l
m.t = l
m.w = f
h.t = c
h.w = f
h.x = n
i.x = n
i.r = m
i.p = c
i.y = c
i.s = c
i.v = f
i.w = f
i.t = h
n.w = c
n.v = m
n.r = d
n.y = h
assert f.r.t.w.z.q.y.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: C = None
        self.p: B = None
        self.r: B = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: G = None
        self.x: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: C = None
        self.t: C = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: B = None
        self.x: H = None
        self.txt = txt

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

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

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

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