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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: G = None
        self.y: G = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

g = A("g")
k = B("k")
l = C("l")
a = D("a")
h = E("h")
f = F("f")
n = G("n")

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: G = None
        self.y: G = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

g = A("g")
k = B("k")
l = C("l")
a = D("a")
h = E("h")
f = F("f")
n = G("n")

g.v = f
g.q = a
g.y = k
k.t = n
l.y = a
l.s = k
a.t = h
a.u = n
a.v = g
a.w = k
h.s = k
h.u = n
h.y = n
h.w = l
f.w = k
n.y = f
n.r = f
n.x = g
n.w = a
n.t = h
n.o = k
assert a.w.t.x.v.txt == "f"