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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: C = None
        self.t: G = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: E = None
        self.q: D = None
        self.u: B = None
        self.o: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: C = None
        self.t: G = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: E = None
        self.q: D = None
        self.u: B = None
        self.o: B = None
        self.txt = txt

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

m.v = b
m.z = b
m.s = k
m.u = k
m.w = c
m.y = c
m.r = d
m.x = g
n.t = f
n.q = f
n.x = k
n.y = e
n.w = m
n.r = c
f.w = l
k.y = b
k.x = l
k.s = m
c.w = d
b.w = m
b.q = c
b.s = f
g.z = b
g.p = f
g.t = l
g.w = n
d.r = b
d.s = c
d.q = k
d.u = e
d.o = n
e.t = f
e.q = f
e.x = k
e.y = n
e.w = m
e.r = c
l.z = b
l.p = f
l.t = g
l.w = e
assert e.t.w.t.p.w.p.w.t.txt == "g"