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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: E = None
        self.v: E = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: E = None
        self.v: E = None
        self.y: C = None
        self.txt = txt

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

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