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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: C = None
        self.s: C = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: C = None
        self.t: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: D = None
        self.w: F = None
        self.p: B = None
        self.z: H = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: F = None
        self.v: D = None
        self.s: F = None
        self.q: C = None
        self.t: D = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: C = None
        self.s: C = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: C = None
        self.t: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: D = None
        self.w: F = None
        self.p: B = None
        self.z: H = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: F = None
        self.v: D = None
        self.s: F = None
        self.q: C = None
        self.t: D = None
        self.z: C = None
        self.txt = txt

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

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