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

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: C = None
        self.p: C = None
        self.y: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: D = None
        self.u: H = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: C = None
        self.p: C = None
        self.y: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: D = None
        self.u: H = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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