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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: E = None
        self.s: H = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: A = None
        self.s: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: E = None
        self.s: H = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: A = None
        self.s: C = None
        self.txt = txt

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

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

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