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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: A = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: E = None
        self.x: G = None
        self.t: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: E = None
        self.z: B = None
        self.o: G = None
        self.s: E = None
        self.u: E = None
        self.w: D = None
        self.t: D = None
        self.txt = txt

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

h.u = f
h.w = g
h.t = j
f.u = b
m.v = b
m.t = b
m.z = h
g.p = e
g.u = e
g.x = b
g.t = h
e.u = g
j.x = e
j.z = f
b.z = f
i.y = e
i.v = e
i.s = e
i.u = e
i.z = f
i.o = b
i.w = g
i.t = g
assert f.u.z.u.z.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: D = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: A = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: E = None
        self.x: G = None
        self.t: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: E = None
        self.z: B = None
        self.o: G = None
        self.s: E = None
        self.u: E = None
        self.w: D = None
        self.t: D = None
        self.txt = txt

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

h.u = f
h.w = g
h.t = j
f.u = b
m.v = b
m.t = b
m.z = h
g.p = e
g.u = e
g.x = b
g.t = h
e.u = g
j.x = e
j.z = f
b.z = f
i.y = e
i.v = e
i.s = e
i.u = e
i.z = f
i.o = b
i.w = g
i.t = g
assert f.u.z.u.z.u.z.txt == "f"