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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: B = None
        self.v: A = None
        self.x: B = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: A = None
        self.v: C = None
        self.w: E = None
        self.t: D = None
        self.z: B = None
        self.o: C = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: B = None
        self.v: A = None
        self.x: B = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: A = None
        self.v: C = None
        self.w: E = None
        self.t: D = None
        self.z: B = None
        self.o: C = None
        self.r: D = None
        self.txt = txt

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

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