class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: H = None
        self.x: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: B = None
        self.r: D = None
        self.w: D = None
        self.z: H = None
        self.x: C = None
        self.s: H = None
        self.txt = txt

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

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

h = A("h")
f = B("f")
l = C("l")
i = D("i")
j = E("j")
b = F("b")
g = G("g")
n = H("n")

h.u = n
h.w = n
h.x = g
f.s = h
f.r = h
f.p = j
f.o = g
l.y = n
l.o = n
l.q = i
l.v = i
l.w = f
i.y = l
i.u = f
j.w = g
j.q = f
j.u = n
b.p = f
b.y = f
b.r = i
b.w = i
b.z = n
b.s = n
b.x = l
g.u = f
g.y = n
n.z = j
assert h.x.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: H = None
        self.x: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: B = None
        self.r: D = None
        self.w: D = None
        self.z: H = None
        self.x: C = None
        self.s: H = None
        self.txt = txt

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

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

h = A("h")
f = B("f")
l = C("l")
i = D("i")
j = E("j")
b = F("b")
g = G("g")
n = H("n")

h.u = n
h.w = n
h.x = g
f.s = h
f.r = h
f.p = j
f.o = g
l.y = n
l.o = n
l.q = i
l.v = i
l.w = f
i.y = l
i.u = f
j.w = g
j.q = f
j.u = n
b.p = f
b.y = f
b.r = i
b.w = i
b.z = n
b.s = n
b.x = l
g.u = f
g.y = n
n.z = j
assert h.x.y.z.txt == "j"