class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: J = None
        self.u: F = None
        self.s: A = None
        self.y: D = None
        self.w: G = None
        self.o: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: A = None
        self.r: J = None
        self.p: A = None
        self.q: A = None
        self.w: I = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: J = None
        self.u: F = None
        self.s: A = None
        self.y: D = None
        self.w: G = None
        self.o: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: A = None
        self.r: J = None
        self.p: A = None
        self.q: A = None
        self.w: I = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

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

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