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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: B = None
        self.w: D = None
        self.v: B = None
        self.x: G = None
        self.txt = txt

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

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

c = A("c")
e = B("e")
a = C("a")
j = D("j")
h = E("h")
l = F("l")
f = G("f")
i = H("i")

c.z = h
e.v = h
a.r = l
j.v = h
j.z = l
j.q = c
h.z = f
h.o = c
l.s = f
l.x = f
l.t = e
l.v = e
l.w = j
f.w = c
f.r = l
i.v = e
i.x = l
i.q = h
i.u = h
i.s = j
assert i.s.z.s.r.s.w.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: B = None
        self.w: D = None
        self.v: B = None
        self.x: G = None
        self.txt = txt

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

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

c = A("c")
e = B("e")
a = C("a")
j = D("j")
h = E("h")
l = F("l")
f = G("f")
i = H("i")

c.z = h
e.v = h
a.r = l
j.v = h
j.z = l
j.q = c
h.z = f
h.o = c
l.s = f
l.x = f
l.t = e
l.v = e
l.w = j
f.w = c
f.r = l
i.v = e
i.x = l
i.q = h
i.u = h
i.s = j
assert i.s.z.s.r.s.w.z.o.txt == "c"