class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.t: F = None
        self.p: C = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: B = None
        self.p: F = None
        self.x: A = None
        self.t: F = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: E = None
        self.p: A = None
        self.r: E = None
        self.txt = txt

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

m = A("m")
h = B("h")
i = C("i")
d = D("d")
e = E("e")
g = F("g")
l = G("l")
c = D("c")

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: B = None
        self.p: F = None
        self.x: A = None
        self.t: F = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: E = None
        self.p: A = None
        self.r: E = None
        self.txt = txt

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

m = A("m")
h = B("h")
i = C("i")
d = D("d")
e = E("e")
g = F("g")
l = G("l")
c = D("c")

m.y = g
m.t = g
m.o = e
m.p = i
m.r = l
h.u = m
i.o = m
i.s = m
i.w = e
d.t = e
d.r = e
d.y = m
d.v = m
d.o = m
d.u = m
d.x = l
e.q = d
e.s = h
e.p = g
e.t = g
e.x = m
e.o = m
g.t = h
g.y = e
g.r = e
g.p = m
l.z = g
l.x = h
c.t = e
c.r = e
c.y = m
c.v = m
c.o = m
c.u = m
c.x = l
assert m.r.x.u.o.t.t.u.txt == "m"