class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.u: G = None
        self.w: E = None
        self.o: B = None
        self.r: F = None
        self.v: J = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: G = None
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: D = None
        self.w: E = None
        self.o: B = None
        self.q: G = None
        self.y: H = None
        self.t: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.u: G = None
        self.w: E = None
        self.o: B = None
        self.r: F = None
        self.v: J = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: G = None
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: D = None
        self.w: E = None
        self.o: B = None
        self.q: G = None
        self.y: H = None
        self.t: A = None
        self.txt = txt

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

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

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