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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.z: E = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: D = None
        self.w: E = None
        self.t: F = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: G = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: B = None
        self.w: C = None
        self.t: A = None
        self.r: D = None
        self.z: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: D = None
        self.txt = txt

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

i = A("i")
d = B("d")
f = C("f")
j = D("j")
a = E("a")
m = F("m")
n = G("n")
h = H("h")

i.t = m
d.r = a
d.z = a
d.y = i
d.v = j
f.q = i
f.r = j
f.w = a
f.t = m
f.x = h
j.u = i
j.z = n
j.q = n
a.p = n
a.q = d
a.w = f
a.t = i
a.r = j
a.z = j
m.z = f
m.p = d
m.x = d
m.y = h
m.w = a
n.p = m
n.t = j
h.w = f
h.x = f
h.o = a
h.u = n
assert f.w.w.t.z.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.z: E = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: D = None
        self.w: E = None
        self.t: F = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: G = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: B = None
        self.w: C = None
        self.t: A = None
        self.r: D = None
        self.z: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: D = None
        self.txt = txt

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

i = A("i")
d = B("d")
f = C("f")
j = D("j")
a = E("a")
m = F("m")
n = G("n")
h = H("h")

i.t = m
d.r = a
d.z = a
d.y = i
d.v = j
f.q = i
f.r = j
f.w = a
f.t = m
f.x = h
j.u = i
j.z = n
j.q = n
a.p = n
a.q = d
a.w = f
a.t = i
a.r = j
a.z = j
m.z = f
m.p = d
m.x = d
m.y = h
m.w = a
n.p = m
n.t = j
h.w = f
h.x = f
h.o = a
h.u = n
assert f.w.w.t.z.x.u.txt == "n"