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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: F = None
        self.t: C = None
        self.y: C = None
        self.r: F = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: D = None
        self.t: E = None
        self.x: A = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: A = None
        self.u: H = None
        self.x: H = None
        self.s: D = None
        self.t: D = None
        self.p: B = None
        self.v: D = None
        self.txt = txt

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

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

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

f = A("f")
h = B("h")
k = C("k")
g = D("g")
m = E("m")
e = F("e")
i = G("i")
l = H("l")
j = I("j")

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: F = None
        self.t: C = None
        self.y: C = None
        self.r: F = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: D = None
        self.t: E = None
        self.x: A = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: A = None
        self.u: H = None
        self.x: H = None
        self.s: D = None
        self.t: D = None
        self.p: B = None
        self.v: D = None
        self.txt = txt

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

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

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

f = A("f")
h = B("h")
k = C("k")
g = D("g")
m = E("m")
e = F("e")
i = G("i")
l = H("l")
j = I("j")

f.o = i
h.z = l
h.u = e
h.r = e
h.t = k
h.y = k
h.v = m
k.o = f
k.x = f
k.w = g
k.t = m
k.r = m
g.x = h
m.q = k
e.r = g
e.s = g
e.t = g
e.v = g
e.z = f
e.u = l
e.x = l
e.p = h
i.r = j
i.u = g
l.w = j
l.z = f
l.q = e
l.y = i
l.s = h
j.v = g
j.w = m
j.o = m
j.t = e
j.q = e
j.z = l
j.u = k
j.x = h
assert k.w.x.z.y.u.x.z.txt == "l"