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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: G = None
        self.y: D = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: D = None
        self.p: G = None
        self.x: B = None
        self.y: H = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: D = None
        self.w: H = None
        self.r: C = None
        self.q: B = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: E = None
        self.t: E = None
        self.w: E = None
        self.p: H = None
        self.v: G = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: F = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: G = None
        self.y: D = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: D = None
        self.p: G = None
        self.x: B = None
        self.y: H = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: D = None
        self.w: H = None
        self.r: C = None
        self.q: B = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: E = None
        self.t: E = None
        self.w: E = None
        self.p: H = None
        self.v: G = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: F = None
        self.r: D = None
        self.txt = txt

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

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