class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: D = None
        self.y: D = None
        self.r: B = None
        self.u: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: E = None
        self.txt = txt

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

i = A("i")
a = B("a")
k = C("k")
n = D("n")
g = E("g")
e = F("e")
f = G("f")
d = C("d")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: E = None
        self.txt = txt

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

i = A("i")
a = B("a")
k = C("k")
n = D("n")
g = E("g")
e = F("e")
f = G("f")
d = C("d")

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