class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: D = None
        self.s: H = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: C = None
        self.z: A = None
        self.p: C = None
        self.w: A = None
        self.x: H = None
        self.s: E = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: H = None
        self.v: H = None
        self.w: B = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: B = None
        self.p: H = None
        self.y: G = None
        self.w: C = None
        self.q: G = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: C = None
        self.o: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: C = None
        self.z: A = None
        self.p: C = None
        self.w: A = None
        self.x: H = None
        self.s: E = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: H = None
        self.v: H = None
        self.w: B = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: B = None
        self.p: H = None
        self.y: G = None
        self.w: C = None
        self.q: G = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: C = None
        self.o: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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