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

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

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

class D:
    def __init__(self, txt: str):
        self.p: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: I = None
        self.w: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: C = None
        self.t: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: I = None
        self.txt = txt

j = A("j")
l = B("l")
g = C("g")
b = D("b")
n = E("n")
a = F("a")
k = G("k")
i = H("i")
c = I("c")
f = J("f")

j.x = a
j.r = a
j.o = c
l.o = a
l.q = f
l.y = b
g.s = b
g.z = k
b.p = f
n.r = j
n.x = c
n.w = c
a.t = j
k.o = n
i.w = l
c.r = g
c.p = g
c.t = n
f.z = n
f.q = c
assert l.q.q.t.w.r.s.p.q.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: I = None
        self.r: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: I = None
        self.w: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: C = None
        self.t: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: I = None
        self.txt = txt

j = A("j")
l = B("l")
g = C("g")
b = D("b")
n = E("n")
a = F("a")
k = G("k")
i = H("i")
c = I("c")
f = J("f")

j.x = a
j.r = a
j.o = c
l.o = a
l.q = f
l.y = b
g.s = b
g.z = k
b.p = f
n.r = j
n.x = c
n.w = c
a.t = j
k.o = n
i.w = l
c.r = g
c.p = g
c.t = n
f.z = n
f.q = c
assert l.q.q.t.w.r.s.p.q.p.z.txt == "k"