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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: B = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: B = None
        self.w: F = None
        self.z: G = None
        self.s: G = None
        self.q: B = None
        self.o: I = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: B = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: B = None
        self.w: F = None
        self.z: G = None
        self.s: G = None
        self.q: B = None
        self.o: I = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

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