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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: B = None
        self.p: E = None
        self.txt = txt

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

g = A("g")
e = B("e")
b = C("b")
c = D("c")
d = E("d")
m = F("m")
k = G("k")
f = H("f")

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: B = None
        self.p: E = None
        self.txt = txt

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

g = A("g")
e = B("e")
b = C("b")
c = D("c")
d = E("d")
m = F("m")
k = G("k")
f = H("f")

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