class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: J = None
        self.r: E = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.u: J = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: D = None
        self.w: H = None
        self.z: H = None
        self.q: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: B = None
        self.q: J = None
        self.o: E = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: F = None
        self.w: I = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: B = None
        self.z: D = None
        self.q: H = None
        self.w: J = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: J = None
        self.r: E = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.u: J = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: D = None
        self.w: H = None
        self.z: H = None
        self.q: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: B = None
        self.q: J = None
        self.o: E = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: F = None
        self.w: I = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: B = None
        self.z: D = None
        self.q: H = None
        self.w: J = None
        self.txt = txt

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

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

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