class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: B = None
        self.p: F = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: D = None
        self.s: G = None
        self.y: F = None
        self.v: G = None
        self.x: B = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: G = None
        self.s: G = None
        self.p: A = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.z: F = None
        self.p: E = None
        self.txt = txt

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

g.v = l
g.t = l
g.p = k
g.z = h
l.p = k
f.p = e
f.s = e
f.v = e
f.q = h
f.y = k
f.x = l
f.w = m
h.p = e
h.v = f
m.v = g
m.p = g
m.w = e
m.s = e
m.q = f
k.s = f
k.t = e
e.w = l
e.q = m
e.p = m
e.z = k
assert m.q.p.z.t.z.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: B = None
        self.p: F = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: D = None
        self.s: G = None
        self.y: F = None
        self.v: G = None
        self.x: B = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: G = None
        self.s: G = None
        self.p: A = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.z: F = None
        self.p: E = None
        self.txt = txt

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

g.v = l
g.t = l
g.p = k
g.z = h
l.p = k
f.p = e
f.s = e
f.v = e
f.q = h
f.y = k
f.x = l
f.w = m
h.p = e
h.v = f
m.v = g
m.p = g
m.w = e
m.s = e
m.q = f
k.s = f
k.t = e
e.w = l
e.q = m
e.p = m
e.z = k
assert m.q.p.z.t.z.t.z.txt == "k"