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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: E = None
        self.o: G = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: B = None
        self.u: B = None
        self.r: A = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.r: D = None
        self.s: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: E = None
        self.o: G = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: B = None
        self.u: B = None
        self.r: A = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.r: D = None
        self.s: G = None
        self.txt = txt

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

c.o = k
f.t = k
f.p = k
f.o = i
f.z = h
a.o = l
a.q = k
h.u = c
h.r = k
k.v = h
m.o = a
i.o = k
i.x = f
i.u = f
i.s = f
i.r = c
l.t = c
l.q = f
l.r = h
l.s = i
assert m.o.q.v.u.o.v.u.txt == "c"