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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: G = None
        self.t: G = None
        self.w: G = None
        self.q: C = None
        self.z: E = None
        self.o: F = None
        self.v: F = None
        self.r: H = None
        self.x: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.w: I = None
        self.q: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: H = None
        self.z: B = None
        self.u: E = None
        self.x: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: H = None
        self.q: E = None
        self.z: E = None
        self.u: D = None
        self.r: H = None
        self.txt = txt

g = A("g")
n = B("n")
l = C("l")
d = D("d")
m = E("m")
i = F("i")
j = G("j")
k = H("k")
c = I("c")
h = J("h")

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: G = None
        self.t: G = None
        self.w: G = None
        self.q: C = None
        self.z: E = None
        self.o: F = None
        self.v: F = None
        self.r: H = None
        self.x: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.w: I = None
        self.q: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: H = None
        self.z: B = None
        self.u: E = None
        self.x: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: H = None
        self.q: E = None
        self.z: E = None
        self.u: D = None
        self.r: H = None
        self.txt = txt

g = A("g")
n = B("n")
l = C("l")
d = D("d")
m = E("m")
i = F("i")
j = G("j")
k = H("k")
c = I("c")
h = J("h")

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