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

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

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

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

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

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

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

k = A("k")
n = B("n")
m = C("m")
c = D("c")
b = E("b")
a = F("a")
l = G("l")

k.x = n
k.y = c
k.v = l
k.r = b
n.t = l
n.s = l
n.z = a
m.y = l
m.t = c
m.p = a
m.s = a
m.o = a
c.s = l
b.v = m
b.z = m
b.x = m
b.s = a
b.r = c
b.q = l
b.y = l
a.t = k
a.s = m
a.o = l
l.v = m
assert m.y.v.t.s.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: D = None
        self.v: G = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

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

k = A("k")
n = B("n")
m = C("m")
c = D("c")
b = E("b")
a = F("a")
l = G("l")

k.x = n
k.y = c
k.v = l
k.r = b
n.t = l
n.s = l
n.z = a
m.y = l
m.t = c
m.p = a
m.s = a
m.o = a
c.s = l
b.v = m
b.z = m
b.x = m
b.s = a
b.r = c
b.q = l
b.y = l
a.t = k
a.s = m
a.o = l
l.v = m
assert m.y.v.t.s.v.s.txt == "a"