class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: C = None
        self.r: G = None
        self.w: H = None
        self.v: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: H = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: C = None
        self.r: I = None
        self.u: G = None
        self.p: A = None
        self.s: A = None
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: J = None
        self.y: H = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: C = None
        self.w: F = None
        self.y: B = None
        self.v: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: H = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: C = None
        self.r: I = None
        self.u: G = None
        self.p: A = None
        self.s: A = None
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: J = None
        self.y: H = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: C = None
        self.w: F = None
        self.y: B = None
        self.v: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: D = None
        self.txt = txt

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

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