class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: J = None
        self.o: C = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: G = None
        self.o: E = None
        self.x: F = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: E = None
        self.r: G = None
        self.o: E = None
        self.t: D = None
        self.x: E = None
        self.u: J = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: J = None
        self.w: B = None
        self.v: E = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: G = None
        self.o: E = None
        self.x: F = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: E = None
        self.r: G = None
        self.o: E = None
        self.t: D = None
        self.x: E = None
        self.u: J = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: J = None
        self.w: B = None
        self.v: E = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: F = None
        self.txt = txt

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

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

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