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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: H = None
        self.q: A = None
        self.y: I = None
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: C = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: H = None
        self.q: A = None
        self.y: I = None
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: C = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

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

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

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

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

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

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