class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: A = None
        self.w: H = None
        self.r: H = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: A = None
        self.w: H = None
        self.r: H = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

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