class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: C = None
        self.t: C = None
        self.txt = txt

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

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

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