class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: D = None
        self.s: D = None
        self.r: C = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: H = None
        self.r: D = None
        self.u: E = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.s: B = None
        self.u: H = None
        self.x: H = None
        self.p: A = None
        self.z: G = None
        self.txt = txt

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

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

f.w = e
f.t = c
f.o = c
f.s = n
f.r = d
e.v = d
d.w = m
d.v = b
d.r = n
d.u = a
d.z = i
c.p = b
c.v = e
a.w = d
a.o = f
g.p = b
g.r = f
g.o = n
i.w = e
i.s = e
i.o = f
i.p = f
i.u = b
i.x = b
i.z = m
b.s = c
b.x = f
m.w = e
m.s = e
m.o = f
m.p = f
m.u = b
m.x = b
m.z = i
n.p = b
n.v = e
assert g.r.t.v.v.w.o.s.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: D = None
        self.s: D = None
        self.r: C = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: H = None
        self.r: D = None
        self.u: E = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.s: B = None
        self.u: H = None
        self.x: H = None
        self.p: A = None
        self.z: G = None
        self.txt = txt

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

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

f.w = e
f.t = c
f.o = c
f.s = n
f.r = d
e.v = d
d.w = m
d.v = b
d.r = n
d.u = a
d.z = i
c.p = b
c.v = e
a.w = d
a.o = f
g.p = b
g.r = f
g.o = n
i.w = e
i.s = e
i.o = f
i.p = f
i.u = b
i.x = b
i.z = m
b.s = c
b.x = f
m.w = e
m.s = e
m.o = f
m.p = f
m.u = b
m.x = b
m.z = i
n.p = b
n.v = e
assert g.r.t.v.v.w.o.s.p.x.txt == "f"