class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: B = None
        self.v: B = None
        self.u: D = None
        self.y: G = None
        self.r: C = None
        self.q: B = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: H = None
        self.u: A = None
        self.t: A = None
        self.r: F = None
        self.o: F = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: A = None
        self.s: H = None
        self.v: B = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: E = None
        self.w: F = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

k.w = i
k.r = i
k.o = i
k.p = j
k.v = j
k.q = j
k.u = g
k.y = m
j.w = k
j.u = k
j.t = k
j.p = n
j.r = h
j.o = h
j.x = f
i.r = k
i.x = k
i.s = n
i.v = j
i.t = f
g.o = f
g.y = f
g.w = h
g.u = n
f.v = g
h.r = g
h.o = k
h.p = k
h.v = k
h.t = m
h.q = m
h.u = j
m.t = f
n.x = g
n.v = k
assert h.v.v.p.x.w.r.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: B = None
        self.v: B = None
        self.u: D = None
        self.y: G = None
        self.r: C = None
        self.q: B = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: H = None
        self.u: A = None
        self.t: A = None
        self.r: F = None
        self.o: F = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: A = None
        self.s: H = None
        self.v: B = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: E = None
        self.w: F = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

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