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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: F = None
        self.r: E = None
        self.p: G = None
        self.w: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: A = None
        self.u: C = None
        self.s: D = None
        self.w: E = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: F = None
        self.r: E = None
        self.p: G = None
        self.w: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: A = None
        self.u: C = None
        self.s: D = None
        self.w: E = None
        self.v: A = None
        self.txt = txt

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

h.w = b
e.o = d
e.p = c
e.u = j
a.o = j
c.x = h
c.y = k
c.o = j
d.z = e
k.s = h
k.v = a
k.p = j
k.y = d
k.w = c
j.x = k
j.o = k
j.r = d
j.p = f
j.w = f
g.y = b
g.w = b
g.z = h
g.v = h
g.u = a
g.s = c
b.z = e
f.x = k
f.o = k
f.r = d
f.p = j
f.w = j
assert h.w.z.p.x.w.z.u.txt == "j"