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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: E = None
        self.r: F = None
        self.u: D = None
        self.s: F = None
        self.x: I = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: D = None
        self.r: F = None
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: C = None
        self.q: F = None
        self.r: D = None
        self.x: D = None
        self.u: C = None
        self.o: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: I = None
        self.r: F = None
        self.z: H = None
        self.x: A = None
        self.q: I = None
        self.p: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: E = None
        self.r: A = None
        self.x: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: E = None
        self.r: F = None
        self.u: D = None
        self.s: F = None
        self.x: I = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: D = None
        self.r: F = None
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: C = None
        self.q: F = None
        self.r: D = None
        self.x: D = None
        self.u: C = None
        self.o: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: I = None
        self.r: F = None
        self.z: H = None
        self.x: A = None
        self.q: I = None
        self.p: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: E = None
        self.r: A = None
        self.x: F = None
        self.txt = txt

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

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