class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: E = None
        self.w: E = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: D = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: B = None
        self.y: B = None
        self.p: D = None
        self.txt = txt

l = A("l")
g = B("g")
c = C("c")
n = D("n")
d = E("d")
k = F("k")
a = G("a")
h = H("h")
e = F("e")
f = H("f")

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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: D = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: B = None
        self.y: B = None
        self.p: D = None
        self.txt = txt

l = A("l")
g = B("g")
c = C("c")
n = D("n")
d = E("d")
k = F("k")
a = G("a")
h = H("h")
e = F("e")
f = H("f")

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