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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: F = None
        self.w: C = None
        self.t: F = None
        self.p: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: E = None
        self.w: A = None
        self.u: A = None
        self.t: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: F = None
        self.u: E = None
        self.x: E = None
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: F = None
        self.w: C = None
        self.t: F = None
        self.p: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: E = None
        self.w: A = None
        self.u: A = None
        self.t: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: F = None
        self.u: E = None
        self.x: E = None
        self.q: E = None
        self.txt = txt

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

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