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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: F = None
        self.s: H = None
        self.v: H = None
        self.o: A = None
        self.x: H = None
        self.u: C = None
        self.w: J = None
        self.t: A = None
        self.p: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: F = None
        self.s: H = None
        self.v: H = None
        self.o: A = None
        self.x: H = None
        self.u: C = None
        self.w: J = None
        self.t: A = None
        self.p: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: E = None
        self.txt = txt

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

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

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

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