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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: D = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.o: C = None
        self.r: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: G = None
        self.y: E = None
        self.v: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: D = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.o: C = None
        self.r: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: G = None
        self.y: E = None
        self.v: B = None
        self.txt = txt

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

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

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