class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: D = None
        self.v: D = None
        self.y: G = None
        self.t: F = None
        self.u: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: D = None
        self.p: A = None
        self.y: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: H = None
        self.w: C = None
        self.o: J = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: B = None
        self.z: A = None
        self.u: D = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: I = None
        self.u: B = None
        self.o: I = None
        self.z: I = None
        self.q: D = None
        self.p: F = None
        self.v: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: D = None
        self.p: A = None
        self.y: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: H = None
        self.w: C = None
        self.o: J = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: B = None
        self.z: A = None
        self.u: D = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: I = None
        self.u: B = None
        self.o: I = None
        self.z: I = None
        self.q: D = None
        self.p: F = None
        self.v: H = None
        self.txt = txt

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

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