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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: E = None
        self.u: E = None
        self.x: E = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: F = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: F = None
        self.t: H = None
        self.s: C = None
        self.o: A = None
        self.x: G = None
        self.q: A = None
        self.r: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: E = None
        self.u: E = None
        self.x: E = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: F = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: F = None
        self.t: H = None
        self.s: C = None
        self.o: A = None
        self.x: G = None
        self.q: A = None
        self.r: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

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