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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: F = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: B = None
        self.o: I = None
        self.t: E = None
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: I = None
        self.t: H = None
        self.s: I = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: F = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: B = None
        self.o: I = None
        self.t: E = None
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: I = None
        self.t: H = None
        self.s: I = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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