class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: C = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: E = None
        self.v: A = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: D = None
        self.v: E = None
        self.u: B = None
        self.txt = txt

m = A("m")
e = B("e")
f = C("f")
g = D("g")
c = E("c")
h = F("h")
k = G("k")
a = H("a")

m.r = g
m.o = f
m.u = f
e.z = h
e.t = c
f.v = c
f.x = m
g.u = k
g.o = k
g.x = h
g.s = h
g.y = c
g.p = c
g.t = f
c.s = a
c.y = a
c.x = k
c.t = e
c.w = e
c.o = h
c.u = h
c.r = f
h.r = g
h.x = e
k.t = g
k.s = c
k.v = m
k.q = e
a.w = c
a.v = c
a.q = g
a.u = e
assert e.z.x.z.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: C = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: E = None
        self.v: A = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: D = None
        self.v: E = None
        self.u: B = None
        self.txt = txt

m = A("m")
e = B("e")
f = C("f")
g = D("g")
c = E("c")
h = F("h")
k = G("k")
a = H("a")

m.r = g
m.o = f
m.u = f
e.z = h
e.t = c
f.v = c
f.x = m
g.u = k
g.o = k
g.x = h
g.s = h
g.y = c
g.p = c
g.t = f
c.s = a
c.y = a
c.x = k
c.t = e
c.w = e
c.o = h
c.u = h
c.r = f
h.r = g
h.x = e
k.t = g
k.s = c
k.v = m
k.q = e
a.w = c
a.v = c
a.q = g
a.u = e
assert e.z.x.z.r.y.txt == "c"