class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: A = None
        self.r: J = None
        self.t: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: J = None
        self.q: E = None
        self.x: D = None
        self.o: F = None
        self.u: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: J = None
        self.r: I = None
        self.u: E = None
        self.s: E = None
        self.w: J = None
        self.q: C = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: B = None
        self.y: D = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.q: I = None
        self.y: E = None
        self.u: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: H = None
        self.u: A = None
        self.q: E = None
        self.v: G = None
        self.r: E = None
        self.z: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: D = None
        self.x: D = None
        self.u: D = None
        self.p: A = None
        self.z: E = None
        self.r: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: A = None
        self.r: J = None
        self.t: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: J = None
        self.q: E = None
        self.x: D = None
        self.o: F = None
        self.u: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: J = None
        self.r: I = None
        self.u: E = None
        self.s: E = None
        self.w: J = None
        self.q: C = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: B = None
        self.y: D = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.q: I = None
        self.y: E = None
        self.u: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: H = None
        self.u: A = None
        self.q: E = None
        self.v: G = None
        self.r: E = None
        self.z: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: D = None
        self.x: D = None
        self.u: D = None
        self.p: A = None
        self.z: E = None
        self.r: C = None
        self.txt = txt

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

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